Skip to content

Refuse bracketed and trailing-dot IP literals in normalize/2 - #987

Merged
benoitc merged 1 commit into
masterfrom
fix/normalize-ip-literal-forms
Oct 25, 2026
Merged

benoitc merged 1 commit into
masterfrom
fix/normalize-ip-literal-forms

Conversation

@benoitc

@benoitc benoitc commented Oct 25, 2026

Copy link
Copy Markdown
Owner

The IP-literal check in hackney_url:normalize/2 (added for CVE-2026-47076) parsed the decoded host as is, while the connect path drops a surrounding [...] and the resolver ignores a trailing dot. A percent-encoded bracketed IPv6 address (%5B%3A%3Affff%3A127%2E0%2E0%2E1%5D) or an IP with a trailing dot (127.0.0.1.) therefore passed the check and still connected to the literal address, including through a redirect.

The check now strips one bracket pair and one trailing dot before parsing. Domain names with a trailing dot and unencoded IPv6 literals are unaffected.

Reported by euriconicacio (GHSA-5643-rgxx-pfw7).

The connect path drops a [...] pair and the resolver ignores a trailing
dot, so %5B%3A%3A1%5D and 127.0.0.1. passed the IP-literal gate and
still reached the address. Strip both before the gate.
@benoitc
benoitc force-pushed the fix/normalize-ip-literal-forms branch from 14b3399 to f19561a Compare October 25, 2026 20:44
@benoitc
benoitc merged commit b1f0a41 into master Oct 25, 2026
11 of 12 checks passed
@benoitc benoitc mentioned this pull request Oct 25, 2026
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