CVE-2023-42282: Ip NPM IP Package Incorrectly Identifies Vulnerability
LOWCVE-2023-42282 is a LOW npm ip package incorrectly identifies vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Ip libraries in the npm ecosystem. The issue involves npm ip package incorrectly identifies some private ip addresses as public. Remediation is available by upgrading affected packages to version 2.0.1, 1.1.9.
CVE-2023-42282 at a Glance
How to Fix CVE-2023-42282
To remediate this vulnerability, upgrade all affected Ip 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 ip@2.0.1
npm install ip@1.1.9
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls ip
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-42282, inspect your project dependencies using npm:
npm ls ip
Analyze the terminal output to locate any version of Ip in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.1), your application is affected.
Note: The npm ls ip 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Ip, 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-42282 Affected Ip Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2023-42282?
Which Ip versions are affected?
What version fixes CVE-2023-42282?
Is ip affected?
What CWE is associated with CVE-2023-42282?
How can I check npm dependencies for CVE-2023-42282?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-78xj-cgh5-2h22",
"modified" : "2024-06-28T16:49:27Z",
"published" : "2024-02-08T18:30:39Z",
"aliases" : [ "CVE-2023-42282" ],
"summary" : "NPM IP package incorrectly identifies some private IP addresses as public",
"details" : "The `isPublic()` function in the NPM package `ip` doesn't correctly identify certain private IP addresses in uncommon formats such as `0x7F.1` as private. Instead, it reports them as public by returning `true`. This can lead to security issues such as Server-Side Request Forgery (SSRF) if `isPublic()` is used to protect sensitive code paths when passed user input. Versions 1.1.9 and 2.0.1 fix the issue.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "ip"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.1"
} ]
} ],
"versions" : [ "2.0.0" ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "ip"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.9"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-42282"
}, {
"type" : "WEB",
"url" : "https://github.com/JoshGlazebrook/socks/issues/93#issue-2128357447"
}, {
"type" : "WEB",
"url" : "https://github.com/github/advisory-database/pull/3504#issuecomment-1937179999"
}, {
"type" : "WEB",
"url" : "https://github.com/indutny/node-ip/pull/138"
}, {
"type" : "WEB",
"url" : "https://github.com/indutny/node-ip/commit/32f468f1245574785ec080705737a579be1223aa"
}, {
"type" : "WEB",
"url" : "https://github.com/indutny/node-ip/commit/6a3ada9b471b09d5f0f5be264911ab564bf67894"
}, {
"type" : "WEB",
"url" : "https://cosmosofcyberspace.github.io/npm_ip_cve/npm_ip_cve.html"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/indutny/node-ip"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2024-02-09T15:03:18Z",
"nvd_published_at" : "2024-02-08T17:15:10Z"
}
}