/

CVE-2026-25763

Severity:

CRITICAL RISK

(9.9)

OS Command Injection in OpenProject Repository Changes

CVE-2026-25763

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution via Arbitrary File Write

Severity:

CRITICAL RISK

(9.9)

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 changes endpoint allows attacker-controlled Git arguments to be passed directly to the underlying SCM command, enabling arbitrary file writes on the server.

Any user with the :browse_repository permission can abuse the rev parameter to inject Git options, write crafted content as files, and ultimately achieve remote code execution under the OpenProject process user.

Affected context

This vulnerability occurs within OpenProject's web-based project repository browsing feature, specifically the /projects/:project_id/repository/changes endpoint when rendering the "latest changes" view via git log.

It manifests when user-supplied repository revision identifiers (rev) are passed to the Git command without strict validation or safe argument handling.

The issue is relevant where:

  • Git is configured as the SCM backend
  • The OpenProject application executes Git commands on behalf of users
  • Users possess :browse_repository permission on at least one project

Exploit preconditions

  • Attack surface: HTTP(S) interface for project repository browsing (/projects/:project_id/repository/changes)
  • Required access: Valid OpenProject account with the :browse_repository permission on the targeted project
  • Trigger point: Supplying a specially crafted rev value that Git interprets as command-line options (e.g., options that control output file paths)
  • Why exploitation is possible: The server constructs and executes an SCM command where the rev parameter is incorporated in a way that allows Git to treat it as arguments, enabling arbitrary file writes and potential script deployment

Why this happens

The core issue is improper handling of user-controlled input in a context where it is later interpreted as part of a system command.

Instead of being treated as a strictly validated revision identifier or hash, the rev parameter is forwarded directly to git log, allowing option injection such as custom output paths.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where untrusted input is concatenated or passed to command-line utilities without robust quoting, whitelisting, or argument separation.

Potential impact

  • Creation or overwriting of arbitrary files writable by the OpenProject process user
  • Upload and persistence of executable shell scripts or other malicious files
  • Remote code execution with the privileges of the OpenProject application user
  • Establishment of reverse shells from the server to attacker-controlled hosts
  • Unauthorized access to sensitive files on the host (e.g., configuration files, /etc/passwd)
  • Further lateral movement or pivoting within the hosting environment

General mitigation guidance

Effective mitigation focuses on treating all SCM-related parameters as untrusted and strictly constraining how they reach the underlying commands.

Recommended patterns include:

  • Using high-level Git libraries or APIs instead of shelling out to raw Git commands whenever possible
  • Enforcing strict allowlists for revision identifiers (e.g., commit hashes, tags) and rejecting any value that does not match expected formats
  • Avoiding direct string concatenation into command lines; instead, pass arguments as discrete, pre-validated parameters to process execution APIs
  • Disabling or stripping any input that begins with - or otherwise resembles a command-line option when a revision or path is expected
  • Running the application under a minimally privileged account with tightly constrained filesystem permissions to reduce the blast radius of any file write
  • Segmenting repositories and application data on the filesystem so that writable locations do not include directories from which code is executed

How teams detect issues like this

Organizations can detect similar vulnerabilities and their potential abuse using a combination of code and runtime analysis:

  • Static analysis: Create rules to flag code paths where HTTP parameters are passed into command execution functions or SCM adapters without strong validation or normalization.
  • Code review signals: Examine repository browsing and SCM integration code for:
  • Direct invocation of git (or other SCM commands) using user-controllable parameters
  • Lack of pattern-based validation for rev, branch names, and commit identifiers
  • Use of shell command wrappers instead of structured argument APIs
  • Runtime monitoring: Inspect application logs for suspicious Git invocations that contain unexpected flags (e.g., --output, --exec, or other advanced options) originating from user requests.
  • Policy enforcement: Incorporate security gates in CI pipelines requiring explicit review of any code that constructs or executes external commands, possibly assisted by automated security review tools.

Sources

SourceLink
github.comgithub.com/opf/openproject/releases/tag/v16.6.7
github.comgithub.com/opf/openproject/releases/tag/v17.0.3
github.comgithub.com/opf/openproject/security/advisories/GHSA-x37c-hcg5-r5m7

Frequently asked

questions

Yes, it can be exploited remotely via the web interface, but the attacker must authenticate and have the :browse_repository permission on a project to reach the vulnerable endpoint.

The attacker needs a valid OpenProject user account with permission to browse the repository of a target project. No shell access or administrative OpenProject rights are required beyond that.

The most robust pattern is to eliminate direct command construction for Git and instead use well-audited libraries that handle arguments safely. When command invocation is unavoidable, enforce strict input validation (e.g., allow only commit hashes or known refs), reject anything resembling options, and use APIs that pass arguments as separate parameters rather than interpolated strings.

Consistently treat all user-provided values as untrusted, especially when they reach command boundaries. Apply strict whitelisting for expected formats, avoid exposing raw SCM flags through user input, minimize the use of shell features, and include dedicated security reviews and automated checks for any code that calls external processes.

Find out what's already
exploitable in your codebase.