Vulnerabilities in pkg:npm/degenerator
PACKAGECVE-2021-23406 is a HIGH (CVSS 8.1) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Pac resolver libraries in the npm ecosystem. The issue involves code injection in pac-resolver. Remediation is available by upgrading affected packages to version 5.0.0, 3.0.1.
pkg:npm/degenerator
Vulnerability advisories affecting package pkg:npm/degenerator. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-9j49-mfvp-vmhm | CVE-2021-23406 | HIGH | Code Injection in pac-resolver |
CVE-2021-23406 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2021-23406
To remediate this vulnerability, upgrade all affected Pac resolver 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 pac-resolver@5.0.0
npm install degenerator@3.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls pac-resolver
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-23406, inspect your project dependencies using npm:
npm ls pac-resolver
Analyze the terminal output to locate any version of Pac resolver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.0), your application is affected.
Note: The npm ls pac-resolver 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Pac resolver, 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-2021-23406 Affected Pac resolver Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pac-resolver
|
npm |
< 5.0.0
|
5.0.0
|
|
degenerator
|
npm |
< 3.0.1
|
3.0.1
|
References
Frequently Asked Questions
What is CVE-2021-23406?
Which Pac resolver versions are affected?
What version fixes CVE-2021-23406?
Is pac-resolver affected?
Is degenerator affected?
What is the CVSS score of CVE-2021-23406?
What CWE is associated with CVE-2021-23406?
How can I check npm dependencies for CVE-2021-23406?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9j49-mfvp-vmhm",
"modified" : "2021-08-25T19:28:31Z",
"published" : "2021-09-02T17:10:06Z",
"aliases" : [ "CVE-2021-23406" ],
"summary" : "Code Injection in pac-resolver",
"details" : "This affects the package pac-resolver before 5.0.0. This can occur when used with untrusted input, due to unsafe PAC file handling. **NOTE:** The fix for this vulnerability is applied in the node-degenerator library, a dependency written by the same maintainer.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "pac-resolver"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.0.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "degenerator"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23406"
}, {
"type" : "WEB",
"url" : "https://github.com/TooTallNate/node-degenerator/commit/9d25bb67d957bc2e5425fea7bf7a58b3fc64ff9e"
}, {
"type" : "WEB",
"url" : "https://github.com/TooTallNate/node-degenerator/commit/ccc3445354135398b6eb1a04c7d27c13b833f2d5"
}, {
"type" : "WEB",
"url" : "https://github.com/TooTallNate"
}, {
"type" : "WEB",
"url" : "https://github.com/TooTallNate/node-pac-resolver/releases/tag/5.0.0"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1568506"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-PACRESOLVER-1564857"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-08-25T19:28:31Z",
"nvd_published_at" : "2021-08-24T08:15:00Z"
}
}