Skip to content

security(fetch): block RFC 6598 CGNAT in the SSRF guard - #163

Merged
luisgf merged 1 commit into
mainfrom
security/audit-156
Aug 13, 2026
Merged

security(fetch): block RFC 6598 CGNAT in the SSRF guard#163
luisgf merged 1 commit into
mainfrom
security/audit-156

Conversation

@luisgf

@luisgf luisgf commented Aug 13, 2026

Copy link
Copy Markdown
Owner

_ip_is_forbidden enumerated is_private / loopback / link-local / reserved / multicast / unspecified. Python does not set is_private on RFC 6598 shared space, so a did:web / status / schema host resolving to 100.64.0.1 (or ::ffff:100.64.0.1) was fetched.

The guard now also rejects not ip.is_global. Multicast stays in the explicit union because some multicast addresses report is_global=True.

Closes #156

Verified: bash .claude/skills/ship-issue/scripts/gate.sh (flake8, mypy, pytest 1636 passed / coverage 91%, build+twine).

is_private does not cover 100.64.0.0/10. The host check now also
rejects addresses with is_global False, including the IPv4-mapped
form.

Closes #156
@luisgf
luisgf merged commit 3c59433 into main Aug 13, 2026
13 of 14 checks passed
@luisgf
luisgf deleted the security/audit-156 branch August 13, 2026 15:03
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.

fetch.py SSRF guard allows RFC 6598 CGNAT (100.64.0.0/10)

1 participant