Skip to content

fix(security): block IPv4-mapped IPv6 SSRF targets in URL-normalized … - #29

Merged
csupenn merged 1 commit into
devfrom
fix/ssrf-ipv4-mapped-hex
Sep 26, 2026
Merged

csupenn merged 1 commit into
devfrom
fix/ssrf-ipv4-mapped-hex

Conversation

@csupenn

@csupenn csupenn commented Sep 26, 2026

Copy link
Copy Markdown
Owner
  • The bug: Node's URL parser rewrites IPv6-wrapped IPv4 addresses into hex, so http://[::ffff:169.254.169.254]/ reaches the
    guard as [::ffff:a9fe:a9fe]. The guard only recognized the dotted form, so a workflow's HTTP Request node could reach
    loopback, private network or cloud-metadata addresses written this way.
  • How it slipped through: the existing test passed the dotted string directly to the host check, which skips the URL parser
    that real requests go through.
  • The fix: decode the hex form back to an IPv4 address and apply the normal blocking rules.
  • The tests: 13 new cases go through checkOutboundUrl, the same call the engine makes. They failed before the fix and pass
    after. They also confirm decimal, octal and hex IPv4 hosts (like http://2130706433/) were already blocked.
  • Tutorial 01 claimed IPv4-mapped addresses were blocked, and for real URLs they weren't. It now has a note explaining this
    finding and a new lab exercise on it; the claim is true again.

…hex form

The WHATWG URL parser rewrites embedded IPv4 in IPv6 hosts to hex before the guard sees them: http://[::ffff:169.254.169.254]/ arrives as [::ffff:a9fe:a9fe]. isBlockedIpv6 only matched the dotted ::ffff:a.b.c.d form, so loopback / private / cloud-metadata targets written this way passed checkOutboundUrl — an SSRF bypass on the HTTP Request node.

  • ssrf.ts: decode hex-embedded IPv4 (::ffff:x:y mapped and deprecated ::x:y compatible) and re-apply the IPv4 block rules
  • tests: new cases go through checkOutboundUrl (the engine's call path), covering hex/expanded IPv6 forms plus decimal/octal/hex IPv4 hosts (already safe via parser normalization); red before, green after
  • tutorial 01: A5 note + post-release finding + parser-differential lab

Found while pointing the builder validation panel at the same guard.

…hex form

The WHATWG URL parser rewrites embedded IPv4 in IPv6 hosts to hex before
the guard sees them: http://[::ffff:169.254.169.254]/ arrives as
[::ffff:a9fe:a9fe]. isBlockedIpv6 only matched the dotted ::ffff:a.b.c.d
form, so loopback / private / cloud-metadata targets written this way
passed checkOutboundUrl — an SSRF bypass on the HTTP Request node.

- ssrf.ts: decode hex-embedded IPv4 (::ffff:x:y mapped and deprecated
  ::x:y compatible) and re-apply the IPv4 block rules
- tests: new cases go through checkOutboundUrl (the engine's call path),
  covering hex/expanded IPv6 forms plus decimal/octal/hex IPv4 hosts
  (already safe via parser normalization); red before, green after
- tutorial 01: A5 note + post-release finding + parser-differential lab

Found while pointing the builder validation panel at the same guard.
@vercel

vercel Bot commented Sep 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
top-flow Ready Ready Preview Sep 26, 2026 11:39pm UTC

@csupenn
csupenn merged commit bb2c582 into dev Sep 26, 2026
5 checks passed
@csupenn
csupenn deleted the fix/ssrf-ipv4-mapped-hex branch September 26, 2026 23:44
@csupenn csupenn mentioned this pull request Sep 26, 2026
Merged
csupenn added a commit that referenced this pull request Sep 26, 2026
 ## Description
  Promote dev → main.

- fix(security): SSRF guard now blocks IPv4-mapped IPv6 targets in the
URL
    parser's hex form, e.g. [::ffff:a9fe:a9fe] = cloud metadata (#29)
  - test(security): validation-engine covered 0% → 100% lines; builder
Validation panel now uses the same SSRF/cycle rules the server enforces
(#30)
- chore(ci): coverage thresholds made honest and blocking; contributor
docs
    refreshed (#28)

  ## Testing
Combined dev verified locally: type-check clean, lint 0 errors, test:ci
603 tests +
  coverage thresholds, build OK.

  ## Security Impact
Closes an SSRF bypass on the HTTP Request node. Residual: DNS rebinding
(documented).

This branch was successfully deployed

1 active deployment
Preview — 0e4fe98b Deployed Sep 26, 2026 by vercel[bot]
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.

1 participant