Skip to content

fix: ip-address vulnerabilities - #1789

Merged
arnaud-moncel merged 1 commit into
mainfrom
fix/ip-adress-vulnerabilities
Jul 29, 2026
Merged

fix: ip-address vulnerabilities#1789
arnaud-moncel merged 1 commit into
mainfrom
fix/ip-adress-vulnerabilities

Conversation

@arnaud-moncel

@arnaud-moncel arnaud-moncel commented Jul 29, 2026

Copy link
Copy Markdown
Member

Definition of Done

fix #1784

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

Note

Replace forest-ip-utils with Node's BlockList for IP whitelist checks

  • Removes the forest-ip-utils dependency and replaces it with Node's built-in net.BlockList for IP allowlist enforcement in ip-whitelist.ts.
  • IpWhitelist.bootstrap now builds an in-memory BlockList from configured rules, supporting single addresses, explicit ranges, and CIDR subnets for both IPv4 and IPv6.
  • Malformed rules are caught and skipped with a Warn log rather than causing a bootstrap failure.
  • IpWhitelist.checkIp now calls BlockList.check with an explicit IP version derived via net.isIPv6, rejecting requests with a Forbidden error when the IP is missing, invalid, or not in the allowlist.
  • Behavioral Change: IP version is now explicitly determined per address; IPv4-mapped IPv6 addresses and compressed IPv6 notations are handled by the new implementation.

Macroscope summarized 5002a7b.

@qltysh

qltysh Bot commented Jul 29, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
packages/agent/src/routes/security/ip-whitelist.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@matthv matthv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@arnaud-moncel
arnaud-moncel merged commit 77bbdda into main Jul 29, 2026
37 checks passed
@arnaud-moncel
arnaud-moncel deleted the fix/ip-adress-vulnerabilities branch July 29, 2026 15:08
forest-bot added a commit that referenced this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove forest-ip-utils from @forestadmin/agent to resolve ip-address vulnerability

2 participants