/

CVE-2026-24685

Severity:

HIGH RISK

(8.8)

OS Command Injection in OpenProject Repository Diff Download

CVE-2026-24685

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77

Impact:

Arbitrary File Write leading to Data Loss and Denial of Service

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenProject's repository diff download endpoint allows attackers to inject additional git command-line options into the underlying git show invocation by supplying a crafted rev parameter.

Any user with :browse_repository permission can abuse this to direct git output to arbitrary filesystem locations writable by the OpenProject process, enabling arbitrary file creation or overwrite and leading to data loss and denial of service.

Affected context

The vulnerability occurs in OpenProject's SCM integration when generating diff downloads at:

  • /projects/:project_id/repository/diff.diff

It affects deployments where:

  • Git is used as the backing repository for a project
  • The application constructs and executes git show commands using user-controlled rev values
  • The :browse_repository permission is granted to project members

In this context, unvalidated rev input is interpreted by Git as command-line options, allowing the output to be redirected to attacker-chosen paths that the OpenProject process user can write to.

Exploit preconditions

  • Attack surface: HTTP(S) interface to the repository diff download endpoint (/projects/:project_id/repository/diff.diff).
  • Required access: Authenticated user with :browse_repository permission on the target project.
  • Trigger point: Providing a specially crafted rev parameter that starts with or contains Git command-line options (e.g., output redirection flags) when requesting a diff for a single revision.
  • Why exploitation is possible: The application incorporates the rev value directly into the git show invocation (or its argument list) without validating it as a safe revision identifier or separating positional arguments from options. Git interprets the user-controlled rev as options such as --output=<path>, enabling writes to arbitrary files accessible to the OpenProject process.

Why this happens

This issue stems from improper handling of user-controlled input when constructing system commands.

The rev parameter, which is intended to represent a revision identifier, is treated as part of the command argument list without robust validation, sanitization, or strict type checking.

As a result, the parameter can be interpreted as Git command-line options (for example, --output=/path/file), which alters the behavior of git show.

This maps to CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where untrusted input influences the execution of a system-level command beyond its intended scope.

Potential impact

  • Creation of arbitrary files containing git show output at locations writable by the OpenProject process user
  • Overwriting of existing application, configuration, or data files, causing data loss
  • Denial of service by corrupting configuration, cache, or runtime files required for normal operation
  • Partial compromise of log or audit integrity if attacker-controlled diff data is written into sensitive log files

General mitigation guidance

Effective mitigation focuses on constraining how user input influences system command execution and file paths:

  • Treat revision identifiers as data, not options: enforce strict whitelisting or schema validation ensuring rev matches allowed Git ref formats (e.g., commit hashes, tags, branch names) and cannot begin with - or contain option-like sequences.
  • Use structured command execution APIs that separate arguments from options and do not permit user-controlled flags; avoid passing raw user input into command-line option positions.
  • Introduce an internal mapping layer where user-facing revision tokens are resolved server-side to known-safe refs, rather than using arbitrary strings directly.
  • Restrict the runtime's filesystem write permissions using least privilege (e.g., dedicated working directories, no write access to application binaries or critical configuration paths).
  • Implement generic hardening for external tool invocations: centralized helpers for SCM commands that consistently validate and sanitize parameters.

How teams detect issues like this

Detection can combine code-level and operational techniques:

  • Static analysis: Define rules to flag external command execution where user input (such as query parameters like rev) is passed into argument lists, especially when it can influence options or file paths.
  • Code review: During manual reviews, pay attention to SCM integration layers and helper functions that wrap git commands; verify that all user-supplied values are validated as safe refs and cannot become flags or redirection options.
  • Security testing: Incorporate fuzzing and negative tests around endpoints that translate user parameters into system commands, checking for unexpected file writes or abnormal command behavior.
  • Runtime monitoring: Log and alert on unusual patterns such as git commands executed with unexpected options, or sudden creation/overwrite of files outside designated repository working directories.

Sources

SourceLink
github.comgithub.com/opf/openproject/security/advisories/GHSA-74p5-9pr3-r6pw

Frequently asked

questions

Yes, if OpenProject is exposed over the network, any authenticated user with the :browse_repository permission on a project can trigger the vulnerability by sending crafted HTTP requests to the repository diff download endpoint.

The attacker must be able to log into OpenProject (or otherwise obtain valid session credentials) and have :browse_repository permission for the target project. No shell access to the server is required; exploitation is performed via the web interface.

The most reliable fix is to ensure that untrusted input is never allowed to alter command options. Validate revision identifiers against strict patterns, reject or normalize values that resemble flags, and invoke Git using APIs or helper functions that construct fixed command templates with user input restricted to safe, positional arguments.

Adopt a defense-in-depth approach: centralize external command invocation, enforce strict input validation and allowlisting for all parameters passed to system tools, minimize application write permissions on the filesystem, and include security checks (static analysis and targeted tests) in the development and CI/CD process for any code that bridges web inputs and system commands.

Find out what's already
exploitable in your codebase.