Vulnerabilities in pkg:npm/n158
PACKAGECVE-2023-26127 is a HIGH (CVSS 7.8) n158 vulnerable to command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting N158 libraries in the npm ecosystem. The issue involves n158 vulnerable to command injection due to improper input sanitization in the 'module.exports' function. Remediation is available in the latest vendor maintenance releases.
pkg:npm/n158
Vulnerability advisories affecting package pkg:npm/n158. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-549h-r7g9-2qpf | CVE-2023-26127 | HIGH | n158 vulnerable to Command Injection due to improper input sanitization in the 'module.exports' function |
CVE-2023-26127 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2023-26127
To remediate this vulnerability, upgrade all affected N158 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install n158@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls n158
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-26127, inspect your project dependencies using npm:
npm ls n158
Analyze the terminal output to locate any version of N158 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The npm ls n158 command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In N158, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-26127 Affected N158 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
n158
|
npm |
≤ 1.4.1
|
|
References
Frequently Asked Questions
What is CVE-2023-26127?
Which N158 versions are affected?
What version fixes CVE-2023-26127?
Is n158 affected?
What is the CVSS score of CVE-2023-26127?
What CWE is associated with CVE-2023-26127?
How can I check npm dependencies for CVE-2023-26127?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-549h-r7g9-2qpf",
"modified" : "2025-01-14T15:51:53Z",
"published" : "2023-05-27T06:30:41Z",
"aliases" : [ "CVE-2023-26127" ],
"summary" : "n158 vulnerable to Command Injection due to improper input sanitization in the 'module.exports' function",
"details" : "All versions of the package n158 are vulnerable to Command Injection due to improper input sanitization in the 'module.exports' function.\n\n**Note:**\n\nTo execute the code snippet and potentially exploit the vulnerability, the attacker needs to have the ability to run Node.js code within the target environment. This typically requires some level of access to the system or application hosting the Node.js environment.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "n158"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "1.4.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-26127"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/dsilva2401/n158"
}, {
"type" : "WEB",
"url" : "https://github.com/dsilva2401/n158/blob/master/src/cli/initProject.js#L8"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JS-N158-3183746"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74", "CWE-77", "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-05-30T20:07:50Z",
"nvd_published_at" : "2023-05-27T05:15:09Z"
}
}