GHSA-5rrq-pxf6-6jx5: Node forge Prototype Pollution Vulnerability
LOWGHSA-5rrq-pxf6-6jx5 is a LOW prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Node forge libraries in the npm ecosystem. The issue involves prototype pollution in node-forge debug api.. Remediation is available by upgrading affected packages to version 1.0.0.
GHSA-5rrq-pxf6-6jx5 at a Glance
How to Fix GHSA-5rrq-pxf6-6jx5
To remediate this vulnerability, upgrade all affected Node forge 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 node-forge@1.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls node-forge
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-5rrq-pxf6-6jx5, inspect your project dependencies using npm:
npm ls node-forge
Analyze the terminal output to locate any version of Node forge in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0), your application is affected.
Note: The npm ls node-forge 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-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Node forge, 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
GHSA-5rrq-pxf6-6jx5 Affected Node forge Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
node-forge
|
npm |
< 1.0.0
|
1.0.0
|
References
Frequently Asked Questions
What is GHSA-5rrq-pxf6-6jx5?
Which Node forge versions are affected?
What version fixes GHSA-5rrq-pxf6-6jx5?
Is node-forge affected?
What CWE is associated with GHSA-5rrq-pxf6-6jx5?
How can I check npm dependencies for GHSA-5rrq-pxf6-6jx5?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5rrq-pxf6-6jx5",
"modified" : "2022-01-07T22:20:53Z",
"published" : "2022-01-08T00:22:42Z",
"aliases" : [ ],
"summary" : "Prototype Pollution in node-forge debug API.",
"details" : "### Impact\nThe `forge.debug` API had a potential prototype pollution issue if called with untrusted input. The API was only used for internal debug purposes in a safe way and never documented or advertised. It is suspected that uses of this API, if any exist, would likely not have used untrusted inputs in a vulnerable way.\n\n### Patches\nThe `forge.debug` API and related functions were removed in 1.0.0.\n\n### Workarounds\nDon't use the `forge.debug` API directly or indirectly with untrusted input.\n\n### References\n- https://www.huntr.dev/bounties/1-npm-node-forge/\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [forge](https://github.com/digitalbazaar/forge).\n* Email us at support@digitalbazaar.com.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "node-forge"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/digitalbazaar/forge/security/advisories/GHSA-5rrq-pxf6-6jx5"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/digitalbazaar/forge"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-07T22:20:53Z",
"nvd_published_at" : null
}
}