What I found
In cloudflared 2026.7.3 (3a2b45c2a511fcdd81b68c190938e4ffadbea5dc), Access metadata discovery can follow an HTTPS redirect to a different application. The redirect-derived AppDomain and AppAUD select that application’s cached JWT. The request builder then creates a new request to the original URL and puts that JWT in Cf-Access-Token.
A remote attacker who controls a valid HTTPS origin can therefore induce a user with a non-expired token for another Access application to run a supported Access workflow and deliver that token to the attacker origin.
The failed invariant: a credential chosen by application domain and audience must only be sent to an authority that owns that namespace.
sequenceDiagram
participant User as Victim cloudflared
participant Att as Attacker HTTPS origin
participant App as Victim Access app
participant Cache as Local JWT cache
User->>Att: Access login or curl of original URL
Att->>App: HTTPS redirect to Access metadata
App-->>User: AppDomain and AppAUD of the real app
User->>Cache: Select JWT for that domain and audience
User->>Att: GET original URL with Cf-Access-Token
How it fails
cmd/cloudflared/access/cmd.gotakes the original URL (login / curl) and callstoken.GetAppInfo.GetAppInfofollows a cross-host redirect and returnsAppDomain/AppAUDfrom the final Access response, without checking they still match the original authority.verifyTokenAtEdgestuffs that discoveredAppInfoplus the original URL intocarrier.StartOptions.carrier.BuildAccessRequestcallstoken.FetchTokenWithRedirectwith the original URL and the discovered metadata.- On the valid-cache fast path,
GetAppTokenIfExists/GenerateAppTokenFilePathFromURLpick a cache file only from discoveredAppDomainandAppAUD. BuildAccessRequestbuilds a GET to the original URL and addsCf-Access-Token, with no compare of destination authority against discovered domain, audience, or issuer.isTokenValidsends it. The same constructor is used fromcarrier/websocket.gofor authenticated carrier handshakes.
CWE-923: the TLS peer is authenticated, but cloudflared does not check that this peer is the intended recipient of the selected application credential. CWE-601 is the redirect; the sink is the credential send.
flowchart TD
URL["Original attacker URL"] --> Info["GetAppInfo follows redirect"]
Info --> Meta["AppDomain and AppAUD from final hop"]
Meta --> Token["Cache lookup by discovered identity"]
URL --> Req["BuildAccessRequest to original URL"]
Token --> Req
Req --> Leak["Cf-Access-Token on the attacker origin"]
Attack shape
- The victim already has a valid cached JWT for a protected Access application.
- The attacker runs a normal HTTPS endpoint and gives the victim an Access URL for it.
- During HEAD discovery, that endpoint redirects to the victim application’s Access metadata.
- cloudflared treats the redirect response as the application identity and loads that JWT.
- It then sends the credential-bearing request to the original attacker URL.
- The attacker captures the bearer and may replay it against the scoped application until expiry, subject to any token-binding policy.
No local access, Cloudflare edge privilege, tenant control, unsafe flag, service-token header, or TLS bypass is required. Certificate validation stays on.
Impact
The victim loses confidentiality of one non-expired, application-scoped Access JWT. The attacker receives that exact cached bearer on the trigger request.
Controls: a legitimate origin and an attacker-own-metadata origin deliver zero victim tokens. Cache deletion on invalid-response branches cannot unsay a token already sent.
Not claimed: successful replay in a production tenant, binding-cookie bypass, cross-tenant admin, RCE, or privilege escalation. Blast radius is one selected application, the token lifetime, and any binding policy. User interaction plus a pre-existing cached token bound the window; they do not make the leak acceptable.
Fix
Bind cache selection and credential attachment to the request’s destination authority. Either:
- refuse to use discovery metadata whose host differs from the original URL, or
- send the selected JWT only to a host that matches
AppDomain/ token audience.
Do not attach Cf-Access-Token to a rebuilt request whose authority is not the application that owns the cache file.
What this is not
Not “the user clicked a link, so any token send is expected.” Access JWTs are application-scoped; a redirect must not retarget them. Distinct from organization-token redirect-cookie mutation and management log-token disclosure: those have different objects and sinks. This is the mismatch between who selected the cache file and who receives the HTTP credential.