Summary
The build-git-clone Node.js package before version 1.0.4 contains an OS command injection vulnerability (CWE-78) in its clone() function. The url argument is concatenated unsanitized into a command executed via sh -c. As a result, shell metacharacters such as ; or $() in a repository URL lead to arbitrary command execution.
Per the CVSS vector (score 9.8, critical), the attack is network-based, low complexity, and requires no authentication or user interaction. The precondition is that an attacker can influence the URL the application passes to clone(). Successful exploitation allows command execution with the privileges of the Node.js process, fully compromising confidentiality, integrity and availability.
The vulnerability is not listed in the CISA KEV catalog. Its EPSS score is about 2.3%, higher than roughly 84% of other vulnerabilities.
Who is affected
Organizations whose Node.js applications, build tooling or CI/CD pipelines use build-git-clone below version 1.0.4, especially where repository URLs may come from untrusted sources.
What to do
- Upgrade build-git-clone to version 1.0.4 or later (fix is in commit 3d55e64 and PR #1 on GitHub).
- Check exposure by searching package.json and lock files (e.g. with npm ls build-git-clone), including transitive dependencies.
- Until you upgrade, do not pass URLs from untrusted sources to clone(). Allow only validated URLs that contain no shell metacharacters such as ; or $().
- Run processes that use the package with least privilege to limit the impact of any exploitation.
- Review build and CI logs for unexpected commands or processes spawned by the Node.js process.
Affected products and versions
CVSS vector, explained
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- Network (from the internet)
- Attack complexity
- Low
- Privileges required
- None (no login)
- User interaction
- Not required
- Scope
- Vulnerable component only
- Confidentiality
- High impact
- Integrity
- High impact
- Availability
- High impact
Weakness type (CWE)
- CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
References
- github.com/emanuelmoraes-dev/build-git-clone/commit/3d55e64e5b7c61e560b5d030d6a918cad5c67a patch
- github.com/emanuelmoraes-dev/build-git-clone/pull/1 patch
- github.com/emanuelmoraes-dev/build-git-clone/blob/68bc305028d04c9a71a030c4b0b5cc36450201b9
- www.vulncheck.com/advisories/build-git-clone-before-1.0.4-os-command-injection-in-clone-vi
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Always check the vendor's official advisory.