Skip to content

Conversation

Copy link

Copilot AI commented Jan 8, 2026

User description

The ip package (CVE-2023-42282) incorrectly identifies private IPs in uncommon formats (e.g., 0x7F.1) as public, enabling SSRF attacks. Versions < 1.1.9 and = 2.0.0 are vulnerable; 1.1.9 and 2.0.1 are patched.

Changes

  • Add "ip": ">=1.1.9" to package.json overrides to enforce patched version
  • Transitive dependency from dns-packet specified ^1.1.0, which would allow vulnerable versions if lock file regenerates

Verification

$ npm explain ip
[email protected] dev overridden
  overridden ip@">=1.1.9" (was "^1.1.0") from [email protected]

Current installation already at 1.1.9; override prevents future regressions.

Original prompt

NPM IP package incorrectly identifies some private IP addresses as public
Low severity GitHub Reviewed Published on Feb 8, 2024 to the GitHub Advisory Database • Updated on Jun 28, 2024
Vulnerability details
Dependabot alerts
0
Package
ip (
npm
)
Affected versions
= 2.0.0
< 1.1.9
Patched versions
2.0.1
1.1.9
Description
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.

References
https://nvd.nist.gov/vuln/detail/CVE-2023-42282
https://cosmosofcyberspace.github.io/npm_ip_cve/npm_ip_cve.html
JoshGlazebrook/socks#93 (comment)
github/advisory-database#3504 (comment)
indutny/node-ip#138
indutny/node-ip@32f468f
indutny/node-ip@6a3ada9


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


PR Type

Bug fix


Description

  • Add npm package override to enforce patched ip version

  • Prevents vulnerable ip versions from being installed

  • Addresses CVE-2023-42282 SSRF vulnerability in ip package

  • Ensures versions >=1.1.9 are used, blocking vulnerable <1.1.9 and 2.0.0


Diagram Walkthrough

flowchart LR
  A["CVE-2023-42282<br/>Vulnerable ip versions"] -- "Override enforces" --> B["ip >= 1.1.9<br/>Patched version"]
  C["dns-packet dependency<br/>^1.1.0 allows vulnerable"] -- "Protected by" --> B
Loading

File Walkthrough

Relevant files
Bug fix
package.json
Add ip package version override for security                         

package.json

  • Added "ip": ">=1.1.9" to the overrides section
  • Prevents installation of vulnerable ip versions (<1.1.9 and 2.0.0)
  • Ensures patched versions (1.1.9 or 2.0.1) are used
  • Protects against transitive dependency from dns-packet
+2/-1     

@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Fix incorrect identification of private IP addresses in NPM IP package Add override to prevent vulnerable ip package versions Jan 8, 2026
Copilot AI requested a review from granatonatalia January 8, 2026 21:27
@granatonatalia granatonatalia marked this pull request as ready for review January 8, 2026 21:46
Copilot AI review requested due to automatic review settings January 8, 2026 21:46
@granatonatalia granatonatalia merged commit 85c915d into master Jan 8, 2026
1 check passed
@qodo-code-review
Copy link

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix incomplete security vulnerability patch

Update the version constraint for the ip package to ^1.1.9 || >=2.0.1 to fully
mitigate a security vulnerability by excluding the known vulnerable 2.0.0
version.

package.json [80]

-"ip": ">=1.1.9"
+"ip": "^1.1.9 || >=2.0.1"
  • Apply / Chat
Suggestion importance[1-10]: 10

__

Why: The suggestion correctly identifies that the PR's security fix is incomplete because it allows the vulnerable ip version 2.0.0. The proposed change fully mitigates the Server-Side Request Forgery (SSRF) vulnerability.

High
  • More

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a package override to address CVE-2023-42282 in the ip package, which incorrectly identifies certain private IP addresses (e.g., 0x7F.1) as public, potentially enabling SSRF attacks.

  • Adds override for ip package to enforce patched versions
  • Prevents future regressions when package-lock.json regenerates
  • Addresses a transitive dependency from dns-packet

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"@types/d3-dispatch": "3.0.6",
"@types/linkify-it": "3.0.5"
"@types/linkify-it": "3.0.5",
"ip": ">=1.1.9"
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version constraint >=1.1.9 will allow the vulnerable version 2.0.0 to be installed. According to the PR description and CVE-2023-42282, version 2.0.0 is vulnerable while versions 1.1.9 and 2.0.1 are patched. The constraint should be updated to either 1.1.9 (to pin to this specific version) or ^1.1.9 (to allow patch updates in the 1.x range but exclude 2.0.0), or use a more explicit constraint like >=1.1.9 <2.0.0 || >=2.0.1 to allow both patched versions while excluding the vulnerable 2.0.0.

Suggested change
"ip": ">=1.1.9"
"ip": ">=1.1.9 <2.0.0 || >=2.0.1"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants