Skip to content

proxy: carry envoyproxy/envoy#47740 (QUIC client hostname check deferred to explicit SAN matchers) on the 726d7ac pin - #972

Merged
bpalermo merged 2 commits into
mainfrom
proxy/carry-envoy-47740
Sep 26, 2026
Merged

bpalermo merged 2 commits into
mainfrom
proxy/carry-envoy-47740

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Second carried patch (after #970's envoy#47743), so #957 path A can be validated in the mtlspool harness against the real proxy binary before it merges upstream.

What

  • proxy/bazel/patches/envoy-47740-quic-hostname-check-explicit-san.patch: envoy_quic_proof_verifier.{h,cc}, quic_client_transport_socket_factory.cc, runtime_features.cc (registers envoy.reloadable_features.quic_hostname_check_deferred_to_explicit_san_match, default true — required or the flag lookup never resolves), and the SPIFFE validator BUILD visibility line. Dropped: the api/ proto doc comment (separate registry module), tests, changelog.
  • proxy/MODULE.bazel: second entry in the override's patch list, applied after 47743 (verified in sequence with git apply --check at 726d7ac); proxy/README.md lists it.
  • bazel build --nobuild --config=release //:envoy //source/extensions/filters/http/aether_stats:aether_stats_test fetches the patched module with the guard registered.

Validation plan (after the bot pin moves the chart to this image)

test/mtlspool QUIC arm with its original path-A configuration: combined_validation_context + match_typed_subject_alt_names URI == destination SPIFFE ID, SNI 18008, destination presenting the URI-only X.509-SVID.

  1. Handshake succeeds, 200s over HTTP/3, no "Leaf certificate doesn't match hostname" in the proxy log, no QUIC_TLS_CERTIFICATE_UNKNOWN pool failures.
  2. Negative control: matcher pointed at a wrong SPIFFE ID → handshake still fails, now on the SAN matcher.
  3. Guard control: the runtime flag false in the bootstrap static layer → the original hostname failure returns.
  4. aether sets no auto_sni / auto_sni_san_validation on any QUIC cluster.
    Production is unaffected: the <port>.<fqdn> SNI and the DNS SANs stay, and remain valid under the fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 2 commits September 26, 2026 20:40
…red to explicit SAN matchers) on the 726d7ac pin

aether#957 path A: Envoy's QUIC client verified the server leaf's DNS SANs
against the SNI after ANY validator succeeded, so a URI-SAN-only SVID with a
port-shaped SNI could never handshake. Upstream #47740 (67af4c692c +
01c09223bd on top of exactly our pin) skips that hostname check when an
explicit identity check is configured (match_typed_subject_alt_names, pins,
a custom validator) and auto_sni_san_validation is off, behind
envoy.reloadable_features.quic_hostname_check_deferred_to_explicit_san_match
(default true; the runtime_features.cc hunk registers the guard).

Second entry in the single_version_override patch list, applied after
47743; source + the SPIFFE validator BUILD visibility line, the api/ doc
comment (separate registry module), tests and changelog dropped. Verified:
`git apply --check` clean in sequence at 726d7ac; `bazel build --nobuild
--config=release //:envoy //...:aether_stats_test` fetches the patched
module with the guard registered.

Validation (test/mtlspool, once the chart pin carries this image): the QUIC
arm with its ORIGINAL path-A config (SNI "18008", URI-only SVID, SAN matcher
on the destination SPIFFE ID) must handshake and answer 200 over HTTP/3;
negative control = a wrong SPIFFE ID in the matcher fails on the SAN matcher,
not the hostname; guard control = the runtime flag set to false in the
bootstrap static layer brings the hostname failure back. Production keeps
the <port>.<fqdn> SNI + DNS SANs (valid under the fix either way).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 7142af4 into main Sep 26, 2026
25 checks passed
@bpalermo
bpalermo deleted the proxy/carry-envoy-47740 branch September 26, 2026 23:56
bpalermo added a commit that referenced this pull request Sep 27, 2026
Parameterise the QUIC harness (quicOptions on startDestinationH3With,
quicTwinWith, startEnvoyQUICWith; the existing entry points delegate with
defaultQUICOptions, so the two selection tests run byte-identical config)
and add the path-A tests for envoyproxy/envoy#47740 (carried by #972):

- TestQUICPathAHandshakesWithoutDNSSANs: URI-only SVID, SNI "18008",
  correct pin -> 200 over HTTP/3 with each caller's identity, no hostname
  / QUIC_TLS_CERTIFICATE_UNKNOWN in the log. RED on the current pin
  (503, "Leaf certificate doesn't match hostname: 18008"); green once the
  chart pins an image with #47740.
- TestQUICPathAWrongSANStillFails: wrong pin -> fails on
  "verify cert failed: SAN matcher", never on the hostname. Green on both
  binaries (the validator runs before the hostname check).
- TestQUICPathAGuardOffRestoresHostnameCheck: runtime guard false ->
  hostname failure returns (anti-vacuity control; green on both).
- TestQUICTwinsLeaveAutoSNIOff: no twin sets auto_host_sni /
  auto_sni_san_validation / auto_sni / auto_san_validation, and the SAN
  pin is present as match_typed_subject_alt_names.

Envoy runs with --component-log-level quic:info,pool:debug for these:
the handshake failure detail is [info][quic], the pool failure code is
[debug][pool].

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo added a commit that referenced this pull request Sep 27, 2026
Parameterise the QUIC harness (quicOptions on startDestinationH3With,
quicTwinWith, startEnvoyQUICWith; the existing entry points delegate with
defaultQUICOptions, so the two selection tests run byte-identical config)
and add the path-A tests for envoyproxy/envoy#47740 (carried by #972):

- TestQUICPathAHandshakesWithoutDNSSANs: URI-only SVID, SNI "18008",
  correct pin -> 200 over HTTP/3 with each caller's identity, no hostname
  / QUIC_TLS_CERTIFICATE_UNKNOWN in the log. RED on the current pin
  (503, "Leaf certificate doesn't match hostname: 18008"); green once the
  chart pins an image with #47740.
- TestQUICPathAWrongSANStillFails: wrong pin -> fails on
  "verify cert failed: SAN matcher", never on the hostname. Green on both
  binaries (the validator runs before the hostname check).
- TestQUICPathAGuardOffRestoresHostnameCheck: runtime guard false ->
  hostname failure returns (anti-vacuity control; green on both).
- TestQUICTwinsLeaveAutoSNIOff: no twin sets auto_host_sni /
  auto_sni_san_validation / auto_sni / auto_san_validation, and the SAN
  pin is present as match_typed_subject_alt_names.

Envoy runs with --component-log-level quic:info,pool:debug for these:
the handshake failure detail is [info][quic], the pool failure code is
[debug][pool].


Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Co-authored-by: Claude Fable 5.1 <[email protected]>
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