Skip to content

fix(metadata-validation): block private fetch targets - #4177

Merged
kusssal merged 1 commit into
IntersectMBO:developfrom
tianpeng-dev:fix/metadata-validation-ssrf-targets
Sep 8, 2026
Merged

fix(metadata-validation): block private fetch targets#4177
kusssal merged 1 commit into
IntersectMBO:developfrom
tianpeng-dev:fix/metadata-validation-ssrf-targets

Conversation

@tianpeng-dev

@tianpeng-dev tianpeng-dev commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

This patch adds outbound URL validation before metadata-validation fetches a submitted metadata URL.

It blocks:

  • unsupported protocols
  • localhost / .localhost
  • loopback, private, link-local, carrier-grade NAT, benchmark, multicast, and reserved IPv4 ranges
  • IPv6 loopback, unspecified, unique-local, link-local, and IPv4-mapped private addresses
  • hostnames that resolve to blocked addresses
  • private addresses that appear during the actual HTTP/HTTPS agent lookup

The goal is to prevent the metadata validator from being used as an SSRF proxy for internal or local network targets.

Related issue

Partially fixes #4142

Verification

  • npm test -- --runInBand (7/7 tests)
  • npm run build
  • git diff --check

I also tried a no-fix ESLint command, but the current project dependency is ESLint 10 while the project still uses .eslintrc.js; ESLint exits before checking files because it expects eslint.config.*.

Notes

No production probing was performed. The new regression tests mock DNS resolution and verify that blocked targets are rejected before HttpService.get is called and again inside the actual request agent lookup.

@kusssal
kusssal self-requested a review September 8, 2026 05:39
@kusssal kusssal closed this Sep 8, 2026
@kusssal kusssal reopened this Sep 8, 2026
@kusssal
kusssal merged commit 52957e6 into IntersectMBO:develop Sep 8, 2026
3 checks passed
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.

馃悰 [Bounty] - SSRF in Metadata-Validation Service via Loopback Escalation to Localhost

2 participants