Skip to content

Reject IDNA dot-variant hosts that normalize to IP literals - #920

Merged
benoitc merged 1 commit into
masterfrom
fix/normalize-idna-ip-bypass
Aug 9, 2026
Merged

Reject IDNA dot-variant hosts that normalize to IP literals#920
benoitc merged 1 commit into
masterfrom
fix/normalize-idna-ip-bypass

Conversation

@benoitc

@benoitc benoitc commented Aug 9, 2026

Copy link
Copy Markdown
Owner

hackney_url:normalize/2 rejects hosts that percent-decode to an IP literal, but the check runs before idnconvert_hostname/1. IDNA folds the Unicode full-stop variants (U+3002, U+FF0E, U+FF61) onto ASCII dots, so a host like 127<U+3002>0<U+3002>0<U+3002>1 is not an IP literal at the gate yet normalizes to 127.0.0.1, bypassing a caller-side SSRF allowlist that ran on the pre-normalized host. Canonicalize those variants before the IP gate so the raw and percent-encoded forms are rejected the same way, independent of the idna library's leniency.

normalize/2 gated hosts that percent-decode to an IP literal but ran the
check before idnconvert_hostname. IDNA folds the Unicode full-stop
variants U+3002/U+FF0E/U+FF61 onto ASCII dots, so a host like
127<U+3002>0<U+3002>0<U+3002>1 is not an IP literal at the gate yet
normalizes to 127.0.0.1, slipping past a caller-side SSRF allowlist.

Canonicalize those full-stop variants before the IP gate so both the raw
and percent-encoded forms are rejected the same way, independent of the
idna library's leniency.
@benoitc
benoitc force-pushed the fix/normalize-idna-ip-bypass branch from 7ec0635 to b07d195 Compare August 9, 2026 09:08
@benoitc
benoitc merged commit 973f0d0 into master Aug 9, 2026
6 checks passed
@benoitc benoitc mentioned this pull request Aug 11, 2026
benoitc added a commit that referenced this pull request Aug 11, 2026
Bundles the fixes merged since 4.7.2 (#914/#915, #918/#919, #920, #921,
#922, #924) and the curl-style Content-Length change (#917/#925). Bumps
dependencies to their latest releases: quic 1.8.0, webtransport 0.4.4,
mimerl 1.5.0, cowboy 2.18.0 (test).
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