CVE-2022-25853
Description
All versions of the semver-tags npm package are vulnerable to command injection via the getGitTagsRemote function due to unsanitized input.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
All versions of the semver-tags npm package are vulnerable to command injection via the getGitTagsRemote function due to unsanitized input.
Vulnerability
Overview
The semver-tags npm package, in all versions, contains a command injection vulnerability in the getGitTagsRemote function [1]. The root cause is improper sanitization of user-supplied input passed to the repoPath option, which is later used in shell commands [2]. The vulnerability was identified by researchers from SJTU and JHU System Security Lab [4].
Exploitation
An attacker can exploit this vulnerability by providing a maliciously crafted repoPath value when calling the semver-tags API or CLI tool [3]. The provided proof-of-concept demonstrates that passing a repoPath containing shell metacharacters (e.g., "; touch EXPLOITED;") results in arbitrary command execution [4]. No authentication is required if the attacker can control the input to the affected function.
Impact
Successful exploitation allows an attacker to execute arbitrary operating system commands in the context of the user running the semver-tags process [1]. This can lead to full compromise of the affected system, including data exfiltration, installation of malware, or lateral movement within a network. The CVSS base score is 7.3 (High) for version 3.1 [4].
Mitigation
As of the publication date (2023-02-06), there is no fixed version of semver-tags available [4]. Users are advised to avoid using the package or to carefully validate and sanitize any user-supplied input, especially repoPath, before passing it to semver-tags [3]. Due to the lack of a patch, the use of this package in production environments is strongly discouraged.
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
semver-tagsnpm | <= 0.4.10 | — |
Affected products
1Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-8h3g-hcwp-6hxqghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-25853ghsaADVISORY
- github.com/jtrussell/semver-tags/blob/db1ba680bafed0d51e1bb36bd38f2c5439fe8b00/lib/get-tags.jsghsaWEB
- github.com/jtrussell/semver-tags/blob/db1ba680bafed0d51e1bb36bd38f2c5439fe8b00/lib/get-tags.js%23L21ghsaWEB
- security.snyk.io/vuln/SNYK-JS-SEMVERTAGS-3175612ghsaWEB
News mentions
0No linked articles in our index yet.