You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pkgs/id/src/web/security.rs:89-97 handles any authority beginning with [ by returning the text before the first ], without validating the remainder. The loopback host guard at :189-197 then checks only that extracted value against allowed_hosts.
Consequently, Host: [::1]attacker.example is reduced to ::1 and passes the loopback allow-list, even though the authority is malformed and contains trailing host text. The same extraction also accepts malformed bracketed forms if their prefix matches an allow-listed address. Existing tests cover valid [::1]:3000 and ordinary disallowed hosts, but not malformed bracketed authorities (:298-330).
This is a malformed-authority validation gap in the loopback guard. Browser exploitability is limited because browsers generally do not generate this Host value from a normal URL; the guard should nevertheless reject invalid authorities rather than allow a misleading host prefix.
Agent: queue worker (repo-worker-code), lane code-a
Session / ID: task 15033
Found via: queue claim
Task: Triage issue id(web): reject malformed bracketed IPv6 Host authorities #8776 — independently verify whether a malformed bracketed IPv6 Host authority ([::1]attacker.example) passes the id web loopback Host guard in pkgs/id/src/web/security.rs, check the valid [::1] and [::1]:3000 controls, assess impact conservatively, and route/do the bounded fix if confirmed.
Agent: queue worker (repo-worker-code), lane code-a
Session / ID: task 15033
Found via: queue claim
Task: Triage of issue id(web): reject malformed bracketed IPv6 Host authorities #8776 — verdict: CONFIRMED by code inspection on current main (e6889a3). host_only in pkgs/id/src/web/security.rs strips [, returns the text before the first ] and never validates the remainder, so Host: [::1]attacker.example reduces to ::1, which is on the loopback allow-list; an unterminated [::1 reduces the same way. Valid controls [::1] and [::1]:3000 are accepted by the existing tests.
Triage decision: work kind small-fix (task/small-fix), priority/normal (a real allow-list validation gap, but browsers do not emit this malformed Host value from a normal URL, so browser exploitability is limited — a non-browser client that can set an arbitrary Host header is the realistic caller), effort/s, kind/security.
First concrete step: add guarded-router + host_only regression tests for malformed bracketed authorities (trailing text, unterminated bracket, non-numeric/empty port tail), watch them fail, then validate the complete bracketed authority in host_only before extracting the host.
Acceptance check: malformed bracketed authorities receive MISDIRECTED_REQUEST (421) on loopback binds; valid [::1] and [::1]:<numeric-port> still pass; the fix stays inside host_only (no Origin-parsing refactor, per the packet scope).
Fix routing: the fix is in this packet's scope, so it proceeds in this same claim per the inline-triage rule — no separate follow-on task.
Agent: queue worker (repo-worker-code), lane code-a
Session / ID: task 15033
Found via: queue claim
Task: Triage + fix of issue id(web): reject malformed bracketed IPv6 Host authorities #8776 — outcome fixed_merged. Verdict: the malformed bracketed IPv6 Host bypass was CONFIRMED (reproduced against the real security.rs: [::1]attacker.example received 200 instead of 421, and host_only reduced it to the allow-listed ::1).
Fix: PR fix(id-web): reject malformed bracketed IPv6 Host authorities (#8776) #8797 (branch queue/15033-8776-host-bracket-fix), squash-merged as 4eb2399. host_only now validates the complete bracketed authority — only an empty tail or a : + numeric port may follow the closing bracket; malformed authorities (trailing host text, non-numeric/empty port, unterminated bracket) no longer reduce to the bracketed host and are refused with 421. Valid [::1] and [::1]:3000 controls still pass.
Tests: regression smoke tests plus two proptest properties for the parser invariant (added for the Codex P1 finding, thread reply 4544361786; Codex re-review on the final head c72d639 completed clean). Because the pkgs/id lib does not compile on main with the web feature (pre-existing, filed as issue pkgs/id: web lib does not compile on main — crate-split visibility left 5 unresolved/private sites in src/web #8795; error set on this branch proven identical to pristine main e6889a3), the security suite was run in a probe harness compiling the real security.rs: 2 new tests red before the fix, 21/21 green after; rustfmt --check on the file clean. PR checks were still pending in the Actions runner stall at merge (none failing); merged under the standing merge criteria.
Impact note: browsers do not emit this malformed Host value from a normal URL; the realistic caller is a non-browser client able to set an arbitrary Host header against a loopback-bound id serve. Severity assessed as a genuine allow-list validation gap, priority/normal.
Activity
developing-today commentedon Nov 11, 2026
CODE-2622
dezren39 commentedon Nov 11, 2026
🤖 Agent note · picked up
[::1]attacker.example) passes the id web loopback Host guard inpkgs/id/src/web/security.rs, check the valid[::1]and[::1]:3000controls, assess impact conservatively, and route/do the bounded fix if confirmed.dezren39 commentedon Nov 11, 2026
🤖 Agent note · triaged
host_onlyinpkgs/id/src/web/security.rsstrips[, returns the text before the first]and never validates the remainder, soHost: [::1]attacker.examplereduces to::1, which is on the loopback allow-list; an unterminated[::1reduces the same way. Valid controls[::1]and[::1]:3000are accepted by the existing tests.host_onlyregression tests for malformed bracketed authorities (trailing text, unterminated bracket, non-numeric/empty port tail), watch them fail, then validate the complete bracketed authority inhost_onlybefore extracting the host.MISDIRECTED_REQUEST(421) on loopback binds; valid[::1]and[::1]:<numeric-port>still pass; the fix stays insidehost_only(no Origin-parsing refactor, per the packet scope).test(id-web): property-test the bracketed authority invariant (#8776)
fix(id-web): reject malformed bracketed IPv6 Host authorities (#8776) (…
dezren39 commentedon Nov 11, 2026
🤖 Agent note · done
security.rs:[::1]attacker.examplereceived 200 instead of 421, andhost_onlyreduced it to the allow-listed::1).queue/15033-8776-host-bracket-fix), squash-merged as 4eb2399.host_onlynow validates the complete bracketed authority — only an empty tail or a:+ numeric port may follow the closing bracket; malformed authorities (trailing host text, non-numeric/empty port, unterminated bracket) no longer reduce to the bracketed host and are refused with 421. Valid[::1]and[::1]:3000controls still pass.proptestproperties for the parser invariant (added for the Codex P1 finding, thread reply 4544361786; Codex re-review on the final head c72d639 completed clean). Because thepkgs/idlib does not compile on main with the web feature (pre-existing, filed as issue pkgs/id: web lib does not compile on main — crate-split visibility left 5 unresolved/private sites in src/web #8795; error set on this branch proven identical to pristine main e6889a3), the security suite was run in a probe harness compiling the realsecurity.rs: 2 new tests red before the fix, 21/21 green after;rustfmt --checkon the file clean. PR checks were still pending in the Actions runner stall at merge (none failing); merged under the standing merge criteria.id serve. Severity assessed as a genuine allow-list validation gap, priority/normal.dezren39 commentedon Nov 11, 2026
🤖 Agent note · done
pkgs/id/src/web/security.rson currentorigin/main.