Skip to content

fix(dpop): preserve non-default port in pinned Host header and htu#8

Merged
muralx merged 1 commit into
mainfrom
fix/dpop-htu-host-port
May 22, 2026
Merged

fix(dpop): preserve non-default port in pinned Host header and htu#8
muralx merged 1 commit into
mainfrom
fix/dpop-htu-host-port

Conversation

@muralx

@muralx muralx commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

DPoP htu validation failed against Authorization Servers listening on a
non-default port. This fixes two coordinated issues:

  • The SSRF-safe pinned HTTP client dropped the port from the outbound Host
    header, so an AS reconstructing the request URI (RFC 9110 §7.2) saw a
    different authority than the proof's htu (RFC 9449 §4.3). It now emits the
    port when it is not the scheme default; IPv6 literals stay bracketed
    (RFC 3986 §3.2.2).
  • DPoP proof generation normalizes htu to match that rule: explicit default
    port (:80/:443) dropped, non-default ports kept, userinfo stripped so
    credentials never leak into the signed proof.

Tests

  • hostHeader unit table (IPv4/IPv6, default/non-default ports)
  • Pinned GET/POST regression tests over IPv4 and IPv6 loopback
  • htu default-port normalization and userinfo-stripping tests

DPoP htu validation failed against Authorization Servers listening on a
non-default port. Two coordinated fixes:

- The SSRF-safe pinned HTTP client dropped the port from the outbound Host
  header, so an AS reconstructing the request URI (RFC 9110 §7.2) saw a
  different authority than the proof's htu (RFC 9449 §4.3). It now emits the
  port when it is not the scheme default, with IPv6 literals bracketed
  (RFC 3986 §3.2.2).
- DPoP proof generation normalizes the htu claim to match that Host-header
  rule: an explicit default port (:80/:443) is dropped, non-default ports are
  kept, and any userinfo is stripped so credentials never leak into the signed
  proof.

Adds regression coverage for the Host header (IPv4 + IPv6), htu default-port
normalization, and htu userinfo stripping.
@muralx
muralx requested a review from a team as a code owner May 22, 2026 09:40
@muralx
muralx requested a review from RobertoIskandarani May 22, 2026 09:41
@muralx
muralx merged commit 988c0c3 into main May 22, 2026
4 checks passed
@muralx
muralx deleted the fix/dpop-htu-host-port branch May 22, 2026 14:56
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.

2 participants