cloudflare / cloudflare/cloudflare-os
SSRF blocklist bypass: normalizeHost() misses dotted hex/octal IPv4, IPv4-compatible IPv6, and zone IDs
- Dominant language
- TypeScript
- Stars
- 9.9k
- Forks
- 1.2k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 107
Description
## Summary
\
ormalizeHost()\ in \packages/mcp-shared/src/endpoint.ts\ normalizes several non-standard IP representations before checking the blocklist, but misses dotted hex and dotted octal representations of private IP addresses.
## Affected Code
[\
ormalizeHost()\](https://github.com/cloudflare/cloudflare-os/blob/main/packages/mcp-shared/src/endpoint.ts#L35-L52) handles:
- ✅ IPv4-mapped IPv6: \[::ffff:7f00:1]\ → \127.0.0.1\
- ✅ Bare integer IPs: \
Contributor guide
Research direction
Start in packages/mcp-shared/src/endpoint.ts at normalizeHost(), referenced around lines 35–52. Review how the existing IPv4-mapped IPv6 and bare integer cases are handled, then cover dotted hexadecimal and octal IPv4 forms, IPv4-compatible IPv6, and zone IDs. Done means these non-standard representations cannot bypass private-IP blocklist checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100