Repository navigation
Description
Under back-to-back proxy rolls, three echo pods on three nodes simultaneously presented another workload's X.509 SVID. Clients correctly rejected them, so this failed closed — but the mesh served the wrong identity, silently, and no aether component noticed.
Observed live on talos-main, chart 0.92.28-e4af095 (#815 releases one and two live). It self-healed in 65 s and has not recurred.
What happened
2026-09-19 22:15:00.0007Z → 22:16:05.995Z (65 s): 163 access-log lines with CERTIFICATE_VERIFY_FAILED.
All three aether-test/echo pods presented spiffe://aether.internal/ns/aether-test/sa/svc-4:
| pod | node | pod IP | ServiceAccount | age at incident |
|---|---|---|---|---|
echo-78779ffdc5-ktn7k |
main-worker-02 | 10.244.4.34 | echo |
3d2h |
echo-78779ffdc5-r4j4c |
main-worker-04 | 10.244.0.185 | echo |
3d2h |
echo-78779ffdc5-x7zbb |
main-worker-05 | 10.244.2.109 | echo |
3d2h |
The IPs were resolved back to the pods explicitly — these are genuinely the echo pods. No pod restart, no IP reuse, no recycled netns on the destination side.
envoy_cluster_ssl_fail_verify_san_total on worker-04 for aether-test/echo stepped 198 → 426 → 491 and has been flat at 491 since 22:16. About 98 prober errors out of 14.9k in the worst 5 m bucket (0.66%). AetherMTLSVerifyFailures (GitOps #109, live since 21:43Z) fired at 22:15:36Z and cleared at 22:21:39Z by draining its 5 m window — a true positive on its first real exercise.
svc-4 is a different Deployment in the same namespace with its own ServiceAccount. It had been scaled 4→8→4 at 20:39Z, ~95 min earlier — the ServiceAccount whose pods churned hardest that day.
The trigger is the cadence, not the roll
A loop of rollout restart ds/aether-proxy → wait for rollout status → wait 60 s → repeat.
VictoriaLogs holds exactly 163 CERTIFICATE_VERIFY_FAILED access-log lines in the last twelve hours, all inside the 22:00 hour, zero before 22:00:00Z. That span covers every single roll, scale, burst and chart upgrade of the day, including the rev222 failure at 17:30Z, the rev225 proxy and agent rolls at 20:52–20:55Z, and the svc-4 4→8→4 burst itself at 20:39Z. Single rolls produce nothing; back-to-back rolls produced this.
Caveat on that evidence: the source proxy's access log can only show failures on requests actually attempted, so a mis-served identity nothing tried to reach in the window would leave no line.
What is ruled out
- SPIRE.
spire-server-03 days old, 0 restarts. All fivespire-agentpods 7h25m old, 0 restarts. Nothing moved near 22:15. The identity source was stable. - Pod churn on the destination side. The echo pods are three days old and were never restarted.
- The client side. Envoy's SAN-mismatch message prints the SANs of the certificate being validated — the one the peer presented. The destinations presented svc-4's identity; the clients were right to reject.
Why nothing alerted from inside aether
No agent logged inbound chain bound to a foreign identity, and no agent logged any WARN or ERROR at all in the window (agents up since 20:54Z, no restarts). That check validates the agent's own snapshot, which was evidently correct. The divergence is between the snapshot the agent believed it published and the secret Envoy actually served on the new epoch — a blind spot the current invariant cannot see.
Leading hypothesis
Destination-side, inside aether: on a new Envoy epoch the echo pod's inbound filter chain briefly held another pod's SDS secret. svc-4 is the likely loser of that race because it is the ServiceAccount that churned most — and the 8→4 scale-down 95 minutes earlier deleted four pods, exactly the population that would leave leaked Broker API subscriptions (cf. #804 / PR #805, the ghost-sweep prune leaking the SVID subscription).
Any explanation must fit all of: three nodes at once, destination-side, no pod churn on the victims, SPIRE stable, agents silent, self-healing in 65 s, and requiring back-to-back rolls — a leaked subscription alone would have shown on a single roll.
Severity
Failed closed here: clients rejected, requests errored. The open question that sets priority is whether the same mechanism can mis-serve an identity that fails open — aether has RBAC and ext_authz policies keyed on source SPIFFE ID (common/extensionfilter/, the OPA preset behind the authz canary), so a wrong client identity would be an authorization issue rather than an availability one.
Wanted
- The concrete interleaving, in
agent/internal/spire/(Broker API client and SDS bridge),agent/internal/xds/cache/, and the inbound chain generation. - Why the
foreign identitycheck cannot see it, and a cheap invariant at snapshot-publish time that turns a silent mis-serve into a loud failure. - Whether
test/envoy_validatecan cover it. - Whether a fail-open direction exists.
Reproduction is in hand: the roll loop is running with envoy_cluster_ssl_fail_verify_san_total, the raw access lines (to determine whether it is always svc-4 or other identities too), destination-node epoch boundaries, and per-secret envoy_sds_* counters all instrumented per roll.
Activity
bpalermo commentedon Sep 19, 2026
Correction: this is CLIENT-side, not destination-side
The original report above concluded the three
echopods served the wrong certificate. That is wrong. New evidence inverts it, and the destination-side hypothesis (leaked Broker API subscriptions, SDS secret races on a new epoch) should not be pursued.What actually happened
All 163 failures came from one source:
pod_name=prober-fjmlm,node_name=main-worker-04,reporter=source.All 163 carry one byte-identical
response_code_details:certificate_SANs_are_[spiffe://aether.internal/ns/aether-test/sa/svc-4]. No other identity appears. Destinations: 10.244.4.34:18008 n=63, 10.244.2.109:18008 n=53, 10.244.0.185:18008 n=47.The decisive fact. The prober is a per-node DaemonSet. The probers on worker-01/02/03/05 were hitting those same three
echopods throughout the window and recorded zero failures. A server presents the same certificate to every client. So theechopods were serving the correct certificate to everyone — only worker-04's proxy experienced them assvc-4. That is impossible for a server-side fault and conclusive for a client-side one, with no reliance on log timestamps.Corroborating, the epochs bracket the client, not the servers:
aether-proxy-92cgh22:14:53.884w05's echo failed entirely before w05's epoch began; w02's failures began 16 s before w02's epoch. Every line sits inside the source proxy's new epoch on w04 — first failure +7 s, last +72 s.
Working hypothesis
aether demuxes on the destination by SNI. If worker-04's new epoch built the
aether-test/echocluster with the wrong transport socket —svc-4's, carryingsvc-4's SNI — then eachechopod's inbound listener matchedsvc-4's filter chain by SNI and correctly presentedsvc-4's certificate, while the client's validation context still expectedecho's SAN. Mismatch, and Envoy prints the presented SANs — exactly the observed string. Every destination behaved faithfully; there is no destination bug and no SPIRE bug.That puts the defect on the surface #815 release two changed hours earlier: the per-source upstream-mTLS
transport_socket_matcher, rekeyed from the source pod's netns path toaether.source.spiffe_idfrom filter state (PR #822, live as chart0.92.28-e4af095). "One sticky wrong identity, 163/163" fits one wrong match entry being selected, not random selection. Determinism in that construction is load-bearing here — map-order nondeterminism has already caused one protocol-visible incident in this repo (full-CDS-replace cascade, fix #135).The severity question that now sets priority
This failed closed only because the validation context still expected
echo's SAN and caught the mismatch. The open question: is there a path where the SNI and the validation context are both wrong and agree with each other? That epoch would then complete a valid handshake to anechopod while believing it wassvc-4, and deliver traffic across a service boundary with no error and no log line — a silent cross-service misroute, and an authorization failure wherever RBAC or ext_authz keys on source identity. Nothing in the evidence suggests this happened; it is not yet known to be impossible.The inference trap, recorded
Envoy's SAN-mismatch message prints the SANs of the certificate being validated — the peer's. That is true, and it is documented in our own
foreign identityheader comment after an earlier bug read the direction backwards. But it establishes only which certificate was presented, not who caused it to be presented. Under SNI demux the client chooses what the server presents. Reading "peer's certificate" as "peer's fault" is the trap, and it cost this investigation its first hour.Still open
The requirement for back-to-back rolls is unexplained under either hypothesis: twelve hours of single rolls, scales and two chart upgrades produced zero lines. Any accepted mechanism must account for it.
bpalermo commentedon Sep 19, 2026
No evidence the silent-crossing case has ever occurred
Measured from the platform side, over the 6 hours containing the only known reproduction.
Method: every successful source-reported request in the access logs (
response_code < 400), grouped to distinct(authority, upstream_host)pairs — 25 distinct pairs covering 1,069,184 requests — each destination IP cross-checked against the live pod/Service IP map (218 addresses), asking: does the pod that actually received this belong to the service named in the authority?Result: 1,069,184 matched, 0 mismatched. Not one successful request was delivered to a pod of a different service.
Two limits on that, which belong with the headline rather than under it:
aether-testworkloads (echo/svc-N/authz-echo); it would not catch a crossing between two pods of the same Deployment, where it also would not matter.So the fail-open path stays theoretically open until the code answers it, but there is no evidence of it occurring in the observable traffic of the window that contains the reproduction. The reason today's incident failed closed really was the validation context catching the mismatch.
Not proposing an alert on this yet:
0 of 1.07Mover one day gives no idea what a false positive looks like, and a wrong alert on a security-shaped signal is worse than none. It is cheap to re-run over a longer window if the code investigation turns up a concrete path.bpalermo commentedon Sep 19, 2026
Retraction: the IP-based crossing check above is unsound — replaced
The method in the previous comment must not be reused. It matched historical access logs against the current pod IP map, and pod IPs get reused, so it manufactures false crossings. Run over 24 h it reported "7 cross-boundary pairs, 694,232 requests" — all seven artifacts. The giveaway:
svc-3 → 10.244.4.105, which currently resolves too11y/otel-collector, a pod not in the mesh that could not have served 32ksvc-3requests. That traffic ran 03:56–04:32Z; the collector took the IP at 15:57:41Z; there are 0 requests to it afterwards. Six more of the same shape (e.g.svc-1 → 10.244.4.110, traffic 05:32–14:49Z, current occupantprober-nkwfjcreated 16:37:20Z).The earlier "0 of 1.07M over 6 h" reached the right answer, but by luck — no IP reassignment happened to land inside that particular window. The number was fine; the method was not, and the method is what would have been reused.
The correct check needs no IPs
The access log carries
upstream_cluster, naming the cluster Envoy actually selected (aether-test/echo), which compares directly against the service inauthority. Exact, reuse-proof, cheap.Successful source-reported requests:
Unclassified in both windows, neither a crossing and both correctly outside the comparison: 9,696 requests with
upstream_cluster=passthrough_original_dst(authorityotel-collector.o11y.svc.cluster.local:43— egress passthrough, no mesh cluster to compare) and 5 withupstream_cluster=-(authorityapi.palermo.dev, no cluster selected).What this does and does not settle
Over seven days and 17.3 M successful requests, not one was delivered to a cluster other than the one its authority named. That rules out routing-level crossing.
It does not address the case this issue actually turns on. If the SNI hypothesis' bad path keeps the correct cluster and only the certificate identity is wrong,
upstream_clusterreads correct and this check is blind to it by construction. The bigger number is therefore less relevant to the open risk than its size suggests. The fail-open question is still answerable only from the transport-socket match breakdown and from the code — not from this query.bpalermo commentedon Sep 19, 2026
Code investigation: the SNI/matcher hypothesis is refuted, and the real gap is named
The #815 release-two matcher is cleared by construction
Within one cluster, every transport socket — every
transport_socket_matchesentry, theon_no_matchsocket, and the no-matcher fallback — is built from onesanURIsand onesni:agent/internal/xds/proxy/egress.go:466—UpstreamTransportSocketMatches(allIDs, validationContextName, sanURIs, sni): one call, one SAN list, one SNI, all identities.agent/internal/xds/proxy/transportsocketmatch.go:120-127— the loop's only per-entry variable isid, used solely as the client-certificate SDS name (transportsocket.go:61).egress.go:456, :464—on_no_matchis in the same identity list, so it carries identical SANs and SNI.egress.go:461— thematcher == nilfallback uses the samesanURIs/sni.The matcher can only ever vary the client certificate. The SAN expectation is a per-cluster constant. It cannot produce an
ssl_fail_verify_san.Determinism is enforced here, contrary to my concern about the #135-class hazard:
sortedUniqueIdentities(transportsocketmatch.go:76-91) sorts and dedups, both the repeated matches and theexact_match_mapderive from that sorted set, anddeterminism_test.go:55-74pins all six snapshot type URLs across 12 shuffled runs.The SNI half is refuted twice over
entry.sniis a bare port number (agent/internal/xds/cache/cluster.go:344,:362,:426,:564), stated outright attransportsocket.go:142-146: "SNI carries the destination PORT … SNI is routing only — identity is the validated SVID/SAN." It can never name a service.And even a wrong SNI could not help: a destination pod's inbound listener derives one
tlsCertificateSecretName := SpiffeIDFromPod(cniPod, trustDomain)(ingress.go:90) and hands that same value to the TCP floor chain (:198) and every per-port HCM chain (:252). No pod's inbound listener contains any other pod's certificate. There is no SNI value any client can send that makes anechopod presentsvc-4's cert.Destination-side hot-restart socket handoff is also ruled out: Envoy's parent handoff is netns-aware on the pinned build (
hot_restarting_child.cc:138,hot_restarting_parent.cc:176-183,address_impl.cc:175-178; envoy#41103 and envoy#43653 both predate1.40.0-dev.20260904.13144fb).The message direction, confirmed in Envoy source
source/common/tls/cert_validator/default_validator.cc:395-397:The SANs of the certificate being validated — the peer's, i.e. the server's. (This is the
subject_alt_name_matchersbranch; theverify_san_overridebranch at:378-381prints a different string, so auto-SAN validation is not in play.) The peer really presented svc-4's certificate, so the TCP connection terminated on an svc-4 workload.The premise I was asked to re-check — it holds
I resolved the three upstream IPs against the live pod map after the burst, which is the pod-IP-reuse trap retracted above. It survives: all three
echopods were created 2026-09-16 19:41–19:45Z with 0 restarts and have held those IPs continuously since. They wereechopods at 22:15Z.That leaves a genuine contradiction — a correctly-pinned cluster dialing a correct endpoint and receiving a wrong certificate — which the code says is not constructible. One of the facts believed here is wrong, and the two fields below will say which.
The decisive data, requested
upstream_clusteron the 163 failing lines (already emitted —accesslog.go:108). If it names theechocluster whileupstream_hostis anechopod, the contradiction is real. If it names a different cluster, this is route-level re-targeting, not an identity bug.aether_probe_requests_totalbynode_nameANDtarget, 22:14–22:17Z, plusenvoy_cluster_ssl_fail_verify_san_totalby node. This tightens or kills the "other probers were clean" control that the client-side conclusion rests on. If w01/w03 simply were not hittingechoin those seconds, the control collapses and destination-side returns.aether_agent_ghost_sweep_stale_pruned_totalon w04 around 22:16:05Z — the 65 s duration matches the agent's 60 s ghost sweep / endpoint resync far better than any supervisor timer (drain 10 s, parent-shutdown 15 s, ready-gate 18 s, predecessor-stale 8 s). A prune landing where the failures stopped would be strong evidence for a contaminated endpoint.Why the source epoch brackets it — exposure, not causation
A fresh Envoy starts with empty connection pools and must complete a new TLS handshake against every endpoint it selects. A warm proxy re-uses connections and re-handshakes only on idle timeout. So a contaminated endpoint is latent in a warm proxy and immediately visible to a cold one. The epoch is the exposure trigger, not the cause — which also reframes the back-to-back cadence as a sampling rate rather than a distinct code state. A search for supervisor or agent state that survives one roll but not two found none (
observedDepsTTL 1 h;onDemandSubsdropped per-stream on both;resumeHeldClustersreturns immediately for a new process; epoch state LIVE-gated and monotonic with both timers inside the 60 s wait).The real gap: nothing cross-checks a cluster's endpoints against its SAN pin
mtls.go:99-113derivessanURIsfromentry.service— never from the endpoints' actual identities.cluster.go:336-345attaches the load assignment fromserviceEndpoints[serviceName]. The two are never compared.Neither identity discriminator can see it. The inbound check (
inboundidentitybinding.go:222-231) is destination-side and inbound-listener-only — its own header says so at:28-29. The outbound check (identitybinding.go:218,:70-82) compares the source pod's client-certificate binding against its own identity; it never reads a Cluster'smatch_typed_subject_alt_names, itstransport_socket_matches, or its CLA. Both are also edge-triggered (diffInboundBindings,:201-210), so a mismatch that persists unchanged is reported once and then silent.Fix direction
The agent cannot even express the check today:
ServiceEndpoint.KubernetesMetadata(api/aether/registry/v1/endpoint.proto:45-63) carriesnamespace,pod_name,node_name,node_ip— noservice_account, soendpointSANNamespaces(cluster.go:498-512) can derive only the namespace half.string service_account = 6;toKubernetesMetadata; populate in the CNI registration path and the k8s registry backend.refreshEntryMTLSLocked(mtls.go:92), after computingsanURIs, assert every endpoint's(namespace, service_account)is covered by the pinned SAN set. On violation, drop the offending endpoint from the CLA (one bad endpoint costs one endpoint, not a service), WARN with service / endpoint IP / endpoint SA / pinned SANs / snapshot version, and countaether.agent.identity.cluster_endpoint_san_mismatch, seeded at zero.Test that would have caught it: build a
clusterEntryforaether-test/echowhose load assignment carries an endpoint withkubernetes_metadata.service_account = "svc-4", runrecomputeMTLSClusters, assert the counter increments and the endpoint is dropped. No test of this shape exists today.test/envoy_validatecannot cover this, and the reason is worth stating: it proves the config loads. Every config in this incident was valid by construction. The defect is a semantic disagreement between two independently-correct fields, and a config loader has no notion of which endpoints ought to be in a load assignment.Split out as separate issues
One latent path recorded, not the cause here
route.go:56-62,:153-177: the capture catch-all resolves its cluster fromClusterHeader: ":authority"— the cluster name is the authority — and the SAN pin travels with the cluster. So anything that corrupts or rewrites:authoritybefore that route silently re-targets the request at a different service with a fully valid, correctly-pinned handshake and no error. There is no independent check that the authority a client asked for is the service it reached. This cannot produce the 163 failures (the pin would agree and it would succeed), but it is the structural fail-open case.bpalermo commentedon Sep 19, 2026
Both surviving hypotheses are now dead, and the contradiction is real
Two measurements were named as decisive. Both came back, and both land on the branch the code says is impossible.
Q1 —
upstream_clusteron all 163 failing lines:aether-test/echo, n=163, one distinct value. Full breakdown byupstream_cluster × upstream_host × route_name × authority: every line isaether-test/echowithroute_name="-", split only across the three echo endpoints and the two authorities the prober uses —echo.aether-test.svc.cluster.local:18081(79 lines: 30/28/21) andecho.aether-test.aether.internal:18081(84 lines: 33/25/26). No svc-4 cluster anywhere, no route re-targeting. H2 (route-level misrouting viaClusterHeader: ":authority") is dead.Q2 — the "other probers were clean" control survives and is stronger than claimed. Window 22:14:00–22:17:00Z,
aether_probe_requests_totalby prober pod × target × result:All five probers hit the same two targets at the same rate (900 per 3 min each, 5/s) in the same window. Four saw zero failures. Only w04 failed, and only on the two mesh targets — its egress target was clean 900/900, consistent with egress not taking the mesh TLS path.
envoy_cluster_ssl_fail_verify_san_totalover the window: worker-04 = 492, and no other node reports the series at all.So the control is not "the others were clean overall" — it is "the others were clean against the identical target, concurrently, at identical volume". H3 (confounded control) is dead.
Additional negatives, all control-tested
envoy_cluster_match_count_total{aether_cluster="aether-test/echo",node=w04}matched…/sa/proberthroughout; no svc-4 match ever. That label is the source-keyed socket from fix(agent): key the per-source mTLS matcher by source SPIFFE ID, not netns path (#815, release 2/3) #822, so it is blind to a wrong upstream SNI — but it does rule out the client presenting the wrong cert.identity_*_binding_mismatch_totalandspiffe_id_override_rejected_total= 0 on all five nodes plus both edge pods; zero WARN and zero ERROR on every agent — while the same log stream carried 1559 DEBUG-1 / 153 DEBUG / 89 DEBUG-4 / 17 INFO lines in that window, so the filter demonstrably works.update_rejectedseries exists at all; w04 legitimately holds bothechoandsvc_4secrets (it hosts pods of both).echopods, SAecho, created 09-16, 0 restarts.Where that leaves it
Correct cluster, correct SAN pin, correct endpoints, correct client certificate, clean agent, clean SDS — and three echo pods that served a correct certificate to four client proxies and an svc-4 certificate to a fifth, in the same 65 seconds. That is not constructible from a per-pod single-secret inbound listener. One of the facts believed here is wrong, and it is no longer any of the ones tested.
Two candidate resolutions, neither yet supported:
upstream_transport_failure_reasonis recorded on the upstream connection, and connection pooling can attach a stream to a connection whose state was established elsewhere. This is the same subsystem as Source SPIFFE ID is not in the upstream pool key: pooled connections carry a foreign client identity into XFCC #831, where the pool hash key provably omits a discriminator it should include. If a pooled connection can carry a foreign source identity in one direction, it is worth establishing whether socket or validation state can cross in the other. This is a hypothesis about Envoy internals, not a finding.The decisive measurement, and why we do not have it
requested_server_nameis the downstream SNI and reads-. Upstream SNI is in no exported surface, and admin and exec are both denied by policy. Until an upstream-SNI field exists in the access log, hypothesis 1 cannot be tested from telemetry at all.#827 (merged, main
cff8beb, not yet deployed) addsupstream_peer_uri_san, which gives the verified peer identity on successful connections — necessary but not sufficient here, since these handshakes failed. An upstream-SNI field is the missing one and should be added.Recurrence: none, across 30 further node-rolls
Rolls 6, 8, 9, 10, 11 produced zero SAN failures and zero prober errors. The counter stepped 108→198→324→426→491 and has been flat at 491 since 22:16:15Z. Only ever one identity (svc-4, 163/163). No
ssl_fail_verify_errororno_certseries ever existed. Cleared by w04's next epoch at 22:18:12Z.So it is 1 occurrence in 55 node-rolls, not a reliable reproducer. The back-to-back cadence raised the sampling rate; it did not create a distinct state (no agent or supervisor state was found that survives one roll but not two).
Query correction for anyone chasing recurrences
_msg:~"CERTIFICATE_VERIFY_FAILED"matches nothing._msgis only"503 URX,UF GET …"; the SAN lives in theupstream_transport_failure_reasonfield. Useresponse_flags:"UF".bpalermo commentedon Sep 19, 2026
Breakthrough: the presented SAN is a CLIENT identity, and #815 is cleared
A second occurrence exists on 2026-09-18, which predates #815 releases one and two entirely. The
_msgquery correction above (response_flags:"UF", SAN lives inupstream_transport_failure_reason) was what made it findable; the earlier "zero before 22:00" claim came from a 12-hour window that did not reach back far enough. Corrected, 7 days by day: 09-18 = 6 lines, 09-19 = 163 lines, nothing else in seven days.The six lines, 2026-09-18 20:45:09Z, all on main-worker-02, all 503, all inside 0.6 seconds:
1. The "peer certificate" is not the peer's
The presented SAN is
spiffe://aether.internal/ns/aether-test/sa/prober— a client identity. Noecho,svc-3orsvc-4pod ever presents the prober's certificate. This is direct evidence, not inference, that on this path the SANs inupstream_transport_failure_reasondo not come from the peer. It confirms the hypothesis recorded in the previous comment and removes the contradiction: nothing impossible happened, the field was read at face value.2. The leaked identity is always a SOURCE-NODE neighbour
prober;prober-bs7tjwas itself one of the failing sources on that node.svc-4; svc-4 had a pod on worker-04 in the 22:10–22:20Z window, alongside svc-2, svc-3, svc-5 and echo.Never the destination's identity. Always a workload co-located with the client.
3. Not per-cluster, not per-destination
Two different source pods, three different clusters, one node, 0.6 s. This is the node's source-side machinery briefly attributing one local identity to everything passing through it.
4. Both occurrences are roll-adjacent, at the same offset
A fresh Envoy with empty connection pools, a few seconds in, both times. Consistent with the earlier finding that a cold pool must re-handshake every endpoint while a warm one re-uses connections — the epoch exposes a latent fault rather than creating one.
5. #815 release two is cleared as the cause
09-18 predates both releases. This matches the code finding that the matcher is cleared by construction, now confirmed empirically rather than only by reading.
Where the investigation goes
The question is now narrow: on a node-shared proxy shortly after a new epoch, how can the certificate validated against an upstream cluster's
match_typed_subject_alt_namesbe a local workload's client certificate rather than the upstream peer's?Two shapes, no current preference between them:
(a) The validation is applied to the wrong certificate object — the upstream SAN matcher runs against a local or downstream peer certificate, either a neighbour's client cert from the node proxy's SDS store or the peer cert of an inbound connection on the same Envoy.
(b) The connection is the wrong connection — per #831, the source identity contributes zero bytes to the upstream pool hash key (
networkfilter.go:175stampsenvoy.string;StringAccessorImplis notHashable;transport_socket_options_impl.cc:47-53gates on that cast).upstream_transport_failure_reasonis recorded on the connection, so the reason can belong to an attempt that is not this stream's.If (b) holds, #829 and #831 are one defect, and #831's severity rises further — the same omission would both mis-attribute identity on success and mis-report it on failure.
Evidence limits
Node-level log collection only went live 09-19 (GitOps #98), so the co-location claim for 09-18 rests on
prober-bs7tjappearing as a source in the same lines — solid, but narrower than the 09-19 case.Rate is 2 occurrences in ~2 days, not 1 in 55 rolls as previously stated.
bpalermo commentedon Sep 19, 2026
Mechanism found: upstream TLS session resumption, and aether's port-SNI makes Envoy's own fix inert
Upstream client-side TLS session resumption is ON by default.
source/common/tls/context_config_impl.cc:404—max_session_keys_defaults to 1, not 0;client_context_impl.cc:107-110enablesSSL_SESS_CACHE_CLIENT. A resumed session carries the peer certificate of the server that created it, and Envoy re-runsmatch_typed_subject_alt_namesagainst that certificate. Resume a session created against server A while dialling server B and the result is, verbatim,verify cert failed: SAN matcher, certificate SANs are [<A's SVID>]— a peer certificate that never came off this connection.On the legacy path (
client_context_impl.cc:292-299) the cache is a flatsession_keys_deque of size 1, andsetSessionFromContextCache(:201) hands back whatever is in it regardless of which server produced it.Envoy knows, and the fix is already in our pinned tree — but it does not save us
source/common/runtime/runtime_features.cc:150—RUNTIME_GUARD(envoy_reloadable_features_scope_upstream_tls_session_cache_by_sni)423e157c63(2026-07-25), "tls: scope upstream session cache by sni (#45982)"client_context_impl.cc:226-229, the fix's own comment: "Keep the cache key in lock-step with the SNI selection used for the actual ClientHello. Reusing sessions across these names can resume the wrong TLS [session]."The scoped cache keys on SNI, because in a normal deployment SNI is the destination hostname and therefore a unique per-service key. aether deliberately repurposed SNI as a port selector —
transportsocket.go:142-146("SNI carries the destination PORT … SNI is routing only"), set fromstrconv.Itoa(int(defaultPort))(cluster.go:344, :362, :426, :564), and empty for the TCP floor (transportsocket.go:91-94) and theinboundready_<pod>probe (cluster.go:494). So every aether upstream context collapses onto a cache key of"8080"or"". The fix's discriminator is a constant here; aether is effectively still on the unscoped path even with the guard on.It satisfies all four constraints
ClientContextImpl; the only certificates in it are those of servers that proxy handshook with. The node proxy's most frequent local mTLS peers are its own pods' inbound listeners — theinboundready_<pod>probe cluster dials127.0.0.1:18008bound into each pod's netns (cluster.go:486-494) and its peer presents that pod's SVID, e.g.…/sa/proberfor prober-bs7tj. That is exactly the population the leaked identity is drawn from, on both days. Nothing else can put a local pod's SVID in front of a client.ClientContextImpl— per cluster and pertransport_socket_matchentry, not per source pod and not per stream. Every source pod on the node shares it. That is the only shared source-side surface that is neither per-cluster nor per-destination.max_session_keyshas defaulted to 1 for years and aether has never set it.Both earlier shapes are dead
(a) validating the wrong certificate object — no path in Envoy hands
DefaultCertValidatora local certificate on the upstream path.verifyCertificate(default_validator.cc:371-405) is reached only from the BoringSSL verify callback with the chain the peer sent, or from a resumed session. Theverify_san_overridebranch (:335-341, :376-390, which printsexpected SANs: [...]) is unreachable: aether sets noauto_sni,auto_san_validationorenvoy.network.upstream_subject_alt_namesanywhere. So bothresponse_code_detailsandupstream_transport_failure_reasonunambiguously carry the peer's SANs (ssl_socket.cc:309).(b) the pool handing back a connection under a different socket — pools are per host (
ThreadLocalClusterManagerImplkeys pool containers byHostConstSharedPtr), so a pool cannot return a connection to a different destination; and every transport socket within one cluster carries identicalsanURIsandsni, so even a maximally wrong socket selection cannot change what is expected of the peer. #829 and #831 are therefore NOT one defect — the hash-key omission mis-attributes identity on success, and cannot mis-report it on failure. #831 stands on its own, and its severity has risen for an independent reason (see there).Fix
Primary, one line per builder, deployable now — disable upstream client session resumption. On the
UpstreamTlsContext:client_context_impl.cc:107and:287-290both short-circuit onmax_session_keys_ == 0: no cache, no resumption, no cross-server session. Aether gains nothing from resumption — upstream connections are long-lived pooled h2, so full handshakes are rare and amortised, and the mesh's security model is precisely "the SVID you see on this connection is the peer". Apply toUpstreamTransportSocket,UpstreamTCPTransportSocket,EdgeUpstreamTransportSocket,EdgeUpstreamTCPTransportSocket, andNewInboundReadyProbeCluster's socket.Secondary — record why SNI is a port. Even with envoy#45982 the cache key is the SNI. Keep SNI as the port and rely on
max_session_keys: 0permanently, but add a comment attransportsocket.go:142-146recording the interaction, or this gets re-broken.Test. One node, two source pods, at least one
inboundready_*probe active: restart the proxy, immediately drive traffic, assertenvoy_cluster_ssl_session_reusedstays 0 on every mesh cluster and nossl_fail_verify_sanoccurs in the first 30 s. Nothing exercises a cold session cache today.test/envoy_validatecannot cover the runtime behaviour, but can assert the field is present on every upstream TLS context — worth adding as a config-shape regression.Confirm-or-kill, running tonight
envoy_cluster_ssl_session_reusedper cluster in the first 60 s after every new epoch. Non-zero on a mesh cluster confirms it. Flat zero across an occurrence that still fails kills it. This needs no config change and is instrumented in tonight's 8-hour soak on rev226.Residual uncertainty, stated plainly
A session cache lives on a
ClientContextImpl, which is per cluster and pertransport_socket_matchentry. Intra-cluster cross-host resumption is clearly reachable (all hosts ofaether-test/echoshare one context per source identity, cache key the constant"8080"). For the 09-18 line whereupstream_clusterwasaether-test/svc-3yet the session appearsinboundready-sourced, the contexts must share anSSL_CTX— requiring either context dedup by config hash or a shared cache that was not fully traced.ssl_session_reusedsettles the mechanism regardless of which contexts share, andmax_session_keys: 0fixes it either way.bpalermo commentedon Sep 19, 2026
CONFIRMED on live data — with a refinement that matters
The confirm-or-kill (
ssl_session_reusednon-zero in the cold-cache window) ran against the 2026-09-19 22:15Z occurrence while it was still in retention.First, a correction to the metric names used above, because they would have returned nothing: the exported names carry
_total—envoy_cluster_ssl_session_reused_total,envoy_cluster_ssl_handshake_total,envoy_cluster_ssl_fail_verify_san_total— and the labels areaether_clusterandnode. There is noenvoy_cluster_name. Same trap onenvoy_cluster_manager_cds_update_failure_total. The series exists and is non-zero on mesh clusters (aether-test/echo870–3,655 per node), proven rather than assumed.The result
ssl_session_reused_totaldropped 400 → 22.ssl_fail_verify_san_total{aether_cluster="aether-test/echo"}first appears 22:15:15Z = 108 → 198 → 324 → 426 → 491 at 22:16:15Z, then flat forever.Access log: the leaked SAN is constant at
…/sa/svc-4, sourceprober-fjmlmon w04,upstream_clusteraether-test/echo, 503URX,UF— and the same SAN appears against two differentupstream_hosts on two different nodes. So the failure reason follows the client-side cache, not any particular host.svc-4-…-stg4mruns on w04, the source node, and itsinboundready_probe cluster shows non-zero reuse there. The co-located-source rule holds exactly.Direct corroboration that Envoy's own fix is inert here: destination access-log lines carry
requested_server_name: "8080". The SNI really is a port selector, so envoy#45982's SNI-scoped cache key collapses to a constant, exactly as argued from the source.The refinement — resumption is necessary but NOT sufficient
The rev226 deploy minted five fresh epochs. Session reuse was non-zero within 30 s on every one, steady at ~25–30 % of handshakes, with zero SAN failures.
So reuse is universal and harmless most of the time. The trigger is which session lands in the single cache slot, not that resumption happens at all. The working hypothesis is that a failure needs a probe-sourced session — from an
inboundready_<pod>cluster, whose peer is a local pod's inbound listener presenting that pod's SVID — to win the slot before the first real upstream connection to a mesh service.This does not change the fix: with
max_session_keys: 0there is no slot to win. It does explain why two occurrences in two days rather than one per epoch, and it is the part worth confirming across many epochs.Still open
Attempt count per failing line cannot be established — there is no attempt field in the access log — so the retry-overwrite alternative is not formally excluded. A constant SAN across differing hosts fits the cache explanation considerably better, but it is not a proof.
Being measured now
The 8-hour soak on rev226 (T0 2026-09-19T23:09:29Z) runs the unfixed build with ~31 rolls, sampling reuse after every epoch along with which
inboundready_*clusters show reuse and which local pods exist on that node. That is the sample that can settle the "which session wins the slot" question. PR #834 is deliberately held unmerged until it completes — merging the fix first would destroy the only opportunity to observe the mechanism live.bpalermo commentedon Sep 19, 2026
Wording precision, because an earlier comment above says "the SANs in that message are not the peer's" and that is now imprecise enough to mislead.
With a resumed session they are a peer's certificate — just the wrong peer: the peer of the session that won the cache slot. Envoy is not reporting something fabricated or misattributed from local state; it is faithfully reporting the identity it validated, which belongs to whichever server created the session being resumed.
That reading fits the evidence better than the original phrasing did. Both occurrences show one cached session reused everywhere rather than anything per-destination: 09-18 a constant
…/sa/proberacross three clusters and two source pods; 09-19 a constant…/sa/svc-4across two upstream hosts on two different nodes. Andrequested_server_namebeing the literal string"8080"is why a cache keyed on SNI cannot separate them — every cluster reached on that port shares one slot.Credit where due: this correction came from the platform side, sharpening a claim I had made too strongly.
bpalermo commentedon Sep 20, 2026
Reproduced in the rev226 soak — third occurrence, third node, and this time SEVEN clusters
The 8-hour soak was deliberately run on the unfixed build with PR #834 held back so the mechanism could show itself. It has.
main-worker-01, 2026-09-20. Proxy roll fired at 03:23:22Z;
envoy_cluster_ssl_fail_verify_san_totalseries all first appear at 03:25:00Z and have been flat since:Prober side:
prober-42w6g(w01) picked up 32mesh_dns http_error— 12 on…aether.internal:18081, 20 on…svc.cluster.local:18081— series that did not exist beforehand.prober-fjmlmstayed flat at its 163 from the 22:15Z event, so the two occurrences are cleanly separable in the counters.Three occurrences now, on three different nodes, all cold-cache and all proxy-roll adjacent:
What is genuinely new
Both previous occurrences were consistent with "one cached session reused everywhere" — one constant presented SAN. Seven clusters simultaneously is the observation most likely to discriminate between that and something broader. The decisive question is whether all seven show the same presented identity or a different one each; those point at different mechanisms. The SAN grouping by
upstream_clusterover 03:22–03:32Z is being pulled.A hypothesis I formed and then refuted — recorded so nobody re-runs it
On seeing w01's reuse counter go 13348 → 906 → 323 across the roll, I hypothesised a double epoch (two hot restarts in ~30 s) as the discriminator, since no other node showed it and no other node failed.
It does not hold. Checking the original 22:15Z occurrence on w04, the counter goes 400 → 22 — exactly one reset — and that node failed anyway. A double epoch is therefore not required.
Worse, the apparent double reset is not trustworthy as evidence at all: Envoy series carry only a
nodelabel, no pod or instance label, so the outgoing and incoming pods' series collide during a handoff (the same class of defect as #809 at the edge). A sum that drops twice may simply be the old pod's series disappearing at a different scrape from the new pod's appearing. Epoch counting fromssl_session_reused_totalis unreliable across a handoff window — count epochs fromssl_handshake_totalresets corroborated against supervisor logs, or better, add a per-pod label.Still consistent
Reuse remains universal and mostly harmless — 28–33% of handshakes on every node in the first 60 s after every epoch, with zero failures on the great majority of rolls. Resumption is necessary but not sufficient; what varies is which session lands in the slot.
bpalermo commentedon Sep 20, 2026
Decisive: seven clusters, ONE identity — and the shared slot is explained
Access-log analysis of the 03:24Z w01 occurrence, all four queries.
Q1 — one distinct presented SAN across all seven clusters:
spiffe://aether.internal/ns/aether-test/sa/authz-echo, 131/131 lines. Not one per cluster. By cluster: echo 46, svc-4 31, svc-2 26, svc-1 19, svc-3 4, uds-echo 3, uds-cr-echo 2.Q2 — simultaneous, not cascading. Six of seven clusters begin within 0.6 s of each other (echo 03:24:12.889, svc-4 .991, svc-2 03:24:13.030, uds-echo .041, svc-1 .298, svc-3 .482; uds-cr-echo trails at .16.605). All end by 03:24:27. Total span ~14 s. One slot poisoned; every cluster that dialled during that window hit it.
Q3 — the co-location rule holds, and this is its strongest test. Both
authz-echoreplicas are on main-worker-01, the source node. And three different source pods produced the lines — k6-soak-loader-mpp49 (94), prober-42w6g (32), uds-client-gchmd (5) — all leaking the same neighbour's identity. That is one cache shared per proxy, not per workload.Q4 — "which session wins the slot" answered, in the negative. Over the window on w01: mesh clusters 4,149 reuses,
inboundready_*2,036, with all 17 probe clusters sitting at exactly 120 — flat, identical, plainly not monopolising anything. Meanwhile mesh clusters vary wildly (echo 2,184, svc-N 365–375, uds-* 209–228). The striking part:authz-echois the least-reusing mesh cluster on that node at 46, and it is the one whose identity leaked. Whatever wins the slot, it is not volume — if anything the opposite of a "busiest cluster wins" story.This resolves the residual uncertainty, and inverts the reading of envoy#45982
The earlier code analysis flagged exactly this as unresolved: a session cache lives on a
ClientContextImpl, per cluster and pertransport_socket_matchentry, so cross-cluster contamination required the contexts to share — "either context dedup by config hash, or a shared cache I did not finish tracing".The data says they share, and there is an obvious candidate for why. envoy#45982 scopes the upstream session cache by SNI. In a normal deployment SNI is the destination hostname, so that scoping partitions the cache per service. aether's SNI is a port number —
requested_server_name: "8080", confirmed live. So every cluster reached on that port collapses into one shared cache entry.That reframes the relationship to the upstream fix. Previous comments here said envoy#45982 is inert for us. On this evidence it is worse than inert: scoping by a key that is constant across our entire mesh turns what would have been a per-context cache into a single node-wide slot, which is precisely the shape observed — seven clusters, three source workloads, one identity, one 14-second window.
This is a strong reading that the data fits, not a proven one. It is testable by flipping the
envoy_reloadable_features_scope_upstream_tls_session_cache_by_sniguard, and it does not change the fix:max_session_keys: 0(PR #834) removes the slot entirely either way.Two numbers, deliberately not collapsed
The counter reports 467 on w01; the access log holds 131 lines for the same window, stable across a wider 03:20–03:35Z window. Both are internally consistent. The likely explanation is that the counter counts handshake attempts while the log records requests, so retried handshakes on one request yield several increments and one line — but that is not proven, and the 3.6:1 ratio does not match the earlier events (22:15Z: 491 counter vs 163 lines = 3.0:1).
So the honest statement of this occurrence is "131 failed requests, 467 SAN-verification failures" — they are different claims and should not be merged into one figure. Same for the earlier event: 163 failed requests, 491 verification failures.
Offset is not tight
Proxy roll 03:23:22Z, first failure 03:24:12.9 — +50 s, against +7 s at 22:15Z and +16 s on 09-18. Still the cold-cache window, but the offset varies by an order of magnitude and should not be characterised as a fixed lag.
Updated occurrence table
sa/probersa/svc-4sa/authz-echoIn every case the leaked identity belongs to a workload co-located on the source node, and in every case exactly one identity is leaked per event.
bpalermo commentedon Sep 20, 2026
The poisoning session is identified: it is an
inboundready_<pod>probe sessionThe remaining question was which session wins the shared slot. It is the inbound-readiness probe's, and the w04 occurrence proves it by elimination.
w04, 2026-09-19 22:15Z — the clean proof
The leaked identity was
…/sa/svc-4. Across the handoff window,aether-test/svc-4's mesh cluster has nossl_session_reused_totalseries at all —echois the only mesh cluster on that node with reuse. So no session presenting svc-4's certificate could have entered the cache via the svc-4 mesh cluster.But this does exist, and resets with the epoch at 22:15:00Z:
svc-4-68898c849f-stg4mruns on w04. The probe cluster dials that pod's inbound listener inside its netns, and that listener presentsspiffe://aether.internal/ns/aether-test/sa/svc-4. That is the only path by which svc-4's certificate could reach this node's client session cache.w01, 2026-09-20 03:24Z — corroboration, with timing
Both
authz-echoreplicas are on w01, and both probe clusters exist:The timing is the interesting part. Per-cluster raw values show the contexts do not all reset on the same scrape:
authz-echo's contexts reset one scrape later than the rest — and the first failure is at 03:24:12.9, between those two resets. The laggard's probe session populated the shared slot, and every mesh cluster resuming from it thereafter was handed a local pod's certificate.All three occurrences fit
sa/proberinboundready_prober-bs7tjsa/svc-4sa/authz-echoThis is exactly why the leaked identity is always a source-node neighbour: the inbound-readiness probe only ever dials pods on its own node, so the only certificates it can deposit in the cache are local ones. The co-location rule was never a coincidence — it is a direct consequence of what the probe talks to.
Reconciling this with the earlier "probe clusters do not monopolise" result
Both are true. The probe clusters reuse at a fixed 12/min health-check cadence (which is why all 17 sat at exactly 120 — ten minutes of it), far below the mesh clusters. But the poisoner only has to win the slot once; it does not need volume. "Not dominant by volume" and "is the poisoner" were never in conflict, and reading the first as excluding the second was my error.
It also explains why
authz-echo— the least-reusing mesh cluster on w01 at 46 — was the identity that leaked. Volume was never the selector.A measurement correction, retracting my own
I previously suggested the apparent double reset in a summed reuse counter was old/new pod series colliding during handoff. That was wrong. The raw per-cluster series each show exactly one clean monotonic reset. The staircase came from summing raw counters across series that reset on different scrapes — a plain PromQL error on my part, not a pod-label collision.
The correct rule is narrower and more useful: never sum raw counters across series with independent resets; inspect the raw per-series shape. The pod-label collision risk (only a
nodelabel, no pod label — cf. #809) is real in principle but was not what happened here, and should be demonstrated per occurrence rather than assumed.Does this change the fix?
No.
max_session_keys: 0(PR #834) removes the slot, so there is nothing for a probe session to poison. But it does suggest a second, independent hardening worth considering: theinboundready_<pod>probe has no business sharing a session cache with mesh traffic at all, and giving it its own context — or simply never resuming on it — would remove this class of contamination even if resumption were wanted elsewhere.bpalermo commentedon Sep 20, 2026
Query correction:
response_flags:"UF"overstates this by 12I propagated
response_flags:"UF"as the way to find these lines. It is too broad. Over the rev226 soak window it returns 143 lines, of which only 131 are this defect.The other 12 (w02 6, w03 5, w04 1) are
delayed_connect_error:_Connection_refusedandconnection_timeoutfrom the destination reporter to its own local app at127.0.0.1:8080during svc pod rolls — an entirely different failure domain that happens to share the response flag.Isolate on the field instead:
response_flags:"UF"remains a fine first cut, but anything quoting it as the count is 12 high. Correcting it here because I had already told two people to use it.Soak result: one occurrence in 8 hours and 31 rolls
rev226, T0 2026-09-19T23:11:22Z → 07:11:22Z, on the unfixed build with #834 held back.
AetherMTLSVerifyFailuresfired 03:25:42Z (349.8/5m, w01) and resolved 03:30:42Z — a true positive, and the only real alert of the run.The counter-to-request ratio is not constant, which matters for anyone quoting a single number: overall 467/131 ≈ 3.6, but per cluster it ranges from 3.2 (echo) to 7.5 (svc-3). So "counter increments" and "failed requests" are not convertible by a fixed factor, and the earlier events' ratios (3.0 at 22:15Z) are not a rate that can be applied. Quote both numbers, per the earlier note.
Per-cluster, counter / requests: echo 149/46 · svc-4 107/31 · svc-2 93/26 · svc-1 73/19 · svc-3 30/4 · uds-echo 9/3 · uds-cr-echo 6/2. Single identity
…/sa/authz-echothroughout, as reported.Rate: 1 occurrence in 31 rolls (6 of them proxy rolls). Rare, self-healing, failing closed — but now reproduced three times across three nodes on demand.
fix(agent): disable upstream TLS session resumption — a resumed sessi…
fix(agent): give the readiness probe its own TLS context, and make an…
feat(agent): select the upstream client certificate per connection, a…
feat(agent): select the upstream client certificate per connection, a…
feat(agent): select the upstream client certificate per connection, a…
feat(agent): select the upstream client certificate per connection, a…
feat(agent): select the upstream client certificate per connection, a…
bpalermo commentedon Sep 20, 2026
Closing: the defect is fixed and the fix is proven on-cluster, not merely merged.
Cause: upstream client-side TLS session resumption. Envoy defaults
max_session_keysto 1, and a resumed session carries the peer certificate of the server that created it, which Envoy then re-checks against the current context's SAN matchers. Resume against one server while dialling another and the handshake reports a peer SVID that never came off the connection.The poisoning session was the
inboundready_<pod>probe's, proved by elimination on w04: the leaked identity had nossl_session_reused_totalseries for its own mesh cluster, whileinboundready_svc-4-…did and reset with the epoch. The probe dials each local pod's inbound listener inside that pod's netns, so its peers are always local pods — which is why the leaked identity was always a source-node neighbour. A consequence, not a coincidence.Fix: #834 set
MaxSessionKeys: 0on every upstream builder. Envoy's own SNI-scoped cache fix (envoy#45982) could not help, because aether's SNI is a port number, so its discriminator is a constant here.Validated on rev227 (2026-09-20):
envoy_cluster_ssl_session_reused_totalran at 33.7–42.9% of handshakes on every node on rev226; on rev227 the series does not exist on any node while handshakes climb. Three controls confirmed the metric family is still exported and the filters can return non-zero, so the absence is real rather than a dead query.Three occurrences total (w02 09-18, w04 09-19, w01 09-20), 165 of 168 hours clean in the week before the fix.
One question deliberately left unresolved rather than holding the issue open: the probe's SNI is empty and mesh clusters' is
"8080", so an SNI-scoped cache with its guard on should have partitioned them. It did not, and we never established why. That is a curiosity about Envoy's cache keying, not a defect in aether, andmax_session_keys: 0makes it moot — there is no slot to share. If it ever matters it belongs in its own issue with a reproduction, not as an open tail on a fixed bug.