CVE-2026-49987

Repomix: Command Injection (RCE) via `--remote-branch` Argument Injection

Published Jul 15, 2026 CVSS 4.0 · 7.5 High EPSS < 1% KEV · Not listed
Description
Repomix is a tool that packs repositories into AI-friendly files. Prior to 1.14.1, src/core/git/gitCommand.ts execGitShallowClone passes the --remote-branch value directly to git fetch and git checkout without validation or --end-of-options, allowing --upload-pack or other Git option injection that bypasses validateGitUrl() dangerous parameter checks and can execute commands through local or SSH-style transports. This issue is fixed in version 1.14.1.

Analysis

AI-generated

Technical impact

Repomix is a tool that packages repositories into AI‑friendly files. In versions prior to 1.14.1 the code that performs a shallow clone passes the value supplied to the "--remote-branch" option directly to the underlying git fetch and git checkout commands without validation or the use of a "--end‑of‑options" marker. This allows an attacker to inject additional Git options, such as "--upload-pack", that bypass the validateGitUrl() checks and can execute arbitrary commands through local or SSH‑style transports. The flaw is a command‑injection vulnerability (CWE‑88) that can give an attacker remote code execution on any host running a vulnerable Repomix instance.

Affected Systems

All releases of Repomix distributed by Yamadashy that are earlier than version 1.14.1 are affected. Users who have not upgraded to 1.14.1 or newer are exposed to the injection flaw.

Risk and Exploitability

The CVSS score of 7.5 indicates a high impact vulnerability, while the EPSS score of < 1 % suggests that exploitation has not been widely observed yet. The flaw is not listed in the CISA KEV catalog. The likely attack vector is inferred to be any entity that can invoke Repomix with a crafted "--remote-branch" argument; this could be a malicious repository maintainer or an automated service that processes untrusted input. Since the flaw can be triggered without additional privilege escalation, it poses a significant threat on systems where Repomix is used to fetch remote repositories.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Repomix to version 1.14.1 or later, which removes the unvalidated argument handling.
  • Disable or restrict the use of the "--remote-branch" option for untrusted repositories until a patch is applied.
  • When invoking git commands, add a "--end‑of‑options" marker or otherwise validate the branch name to prevent injected Git options.

Generated by OpenCVE AI on July 31, 2026 at 03:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-9mm9-rqhj-j5mx repomix Vulnerable to Command Injection (RCE) via `--remote-branch` Argument Injection
History
Type Values Removed Values Added
CPEs cpe:2.3:a:yamadashy:repomix:*:*:*:*:*:*:*:*
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Yamadashy
Yamadashy repomix
Vendors & Products Yamadashy
Yamadashy repomix
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Repomix is a tool that packs repositories into AI-friendly files. Prior to 1.14.1, src/core/git/gitCommand.ts execGitShallowClone passes the --remote-branch value directly to git fetch and git checkout without validation or --end-of-options, allowing --upload-pack or other Git option injection that bypasses validateGitUrl() dangerous parameter checks and can execute commands through local or SSH-style transports. This issue is fixed in version 1.14.1.
Title Repomix: Command Injection (RCE) via `--remote-branch` Argument Injection
Weaknesses CWE-88
References
Metrics cvssV4_0

{'score': 7.5, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-88

    Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 15, 2026, 7:40 PM
Reserved
Jun 2, 2026, 6:30 PM
Status
Analyzed
Published
Jul 15, 2026, 7:17 PM
Modified
Oct 24, 2026, 9:10 PM