CVE-2026-49987 is a high-severity security vulnerability in repomix (npm), affecting versions < 1.14.1. It is fixed in 1.14.1.
Vulnerability Metadata | Field | Detail | | --- | --- | | Affected Component | src/core/git/gitCommand.ts (execGitShallowClone) | | Impact | Arbitrary Command Execution / Security Control Bypass | Summary The --remote-branch CLI option in repomix is vulnerable to argument injection. User-supplied input is passed directly to git fetch and git checkout subprocesses via childprocess.execFileAsync without sanitization, -- delimiters, or validation. An attacker can inject arbitrary git command-line options. By injecting the --upload-pack option and specifying an SSH (git@...) or local (file://) remote URL, an attacker achieves arbitrary command execution with the privileges of the user running repomix. This bypasses the existing dangerousParams blocklist implemented in validateGitUrl(). Vulnerable Code Analysis File: src/core/git/gitCommand.ts The remoteBranch parameter is appended directly to the arguments array for git subprocesses without the -- positional delimiter. Sink 1 (Lines 118-127): Sink 2 (Lines 148-151): Bypassed Security Control (Lines 192-197): The application attempts to prevent this exact vulnerability class by blocking dangerous parameters (--upload-pack, --receive-pack, --config, --exec) within the validateGitUrl function. However, this validation is exclusively applied to the url variable and omitted for remoteBranch, creating a direct bypass. Attack Flow Proof of Concept (Steps to Reproduce) Create the Payload Create an executable bash script that writes system execution context to a file. (Reference: Screenshot2026-05-18130216.png) Trigger the Vulnerability Establish a dummy remote and trigger the fetch operation, injecting the --upload-pack argument. (Reference: Screenshot2026-05-18130836.png) Verify Execution Execution occurs prior to git protocol validation. The script executes successfully despite the fetch operation returning a 128 exit code. Expected Output: End-to-End Execution via Repomix: Impact Remote Code Execution: Complete system compromise with the privileges of the user executing repomix. CI/CD Compromise: If repomix is utilized in automated pipelines where --remote-branch is populated by external triggers (e.g., webhook payloads, PR titles), attackers can compromise build servers and exfiltrate secrets. Remediation Implement Positional Delimiters (Primary Fix) Append the -- delimiter to explicitly separate options from positional arguments in all git subprocess calls utilizing remoteBranch. Apply Existing Blocklist to Branch Parameter (Defense in Depth) Update execGitShallowClone to validate remoteBranch against the existing dangerousParams array. Attachments Screenshot 1: Payload script created with executable permissions. <img width="1920" height="1080" alt="Screenshot2026-05-18130216" src="https://github.com/user-attachments/assets/a0ada9de-c689-4ed8-9937-dd7faf6e6cc0" /> Screenshot 2: Vulnerable Code <img width="1920" height="1080" alt="Screenshot2026-05-18130344" src="https://github.com/user-attachments/assets/b72c7e05-d857-497a-9ae5-0822f86fa032" /> Screenshot 3: Verifying RCE. <img width="1920" height="1080" alt="Screenshot2026-05-181308_36" src="https://github.com/user-attachments/assets/f153545e-e5e8-4165-ac1a-f84efbb1c135" /> Credits This vulnerability was discovered and responsibly disclosed by: Researcher: Abhijith S. GitHub: @kakashi-kx HackerOne/Bugcrowd: kakashi4kx
CVE-2026-49987 has a CVSS score of 8.8 (High). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.
A fixed version is available (1.14.1). Upgrading removes the vulnerable code path.
npm
repomix (< 1.14.1)repomix → 1.14.1 (npm)Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.
Kodem's runtime-powered SCA identifies whether CVE-2026-49987 is reachable in your applications. Explore open-source security for your team.
See if CVE-2026-49987 is reachable in your applications. Get a demo
Already deployed Kodem? See CVE-2026-49987 in your environment →Upgrade repomix to 1.14.1 or later to resolve this vulnerability.
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
CVE-2026-49987 is a high-severity security vulnerability in repomix (npm), affecting versions < 1.14.1. It is fixed in 1.14.1.
CVE-2026-49987 has a CVSS score of 8.8 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
repomix (npm) versions < 1.14.1 is affected.
Yes. CVE-2026-49987 is fixed in 1.14.1. Upgrade to this version or later.
Whether CVE-2026-49987 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
Upgrade repomix to 1.14.1 or later.