x5u (X.509 URL) Header Parameter in a JWT
x5u is a URL pointing at the X.509 certificate or chain matching the signing key. It has the same trust and request forgery problems as jku, with certificate chain validation added on top.
At a glance
- Parameter
- x5u (X.509 URL)
- Defined in
- RFC 7515 section 4.1.5
- Value type
- URI pointing at a PEM encoded certificate or certificate chain
- Required
- Optional, and uncommon outside deployments already built on X.509
- Ordering rule
- The certificate holding the signing key must come first, each following one certifying the previous.
- In the decoder
- Displayed as text in the header. Nothing is fetched, and verification uses a PEM public key you paste.
In detail
Where jku points at a key set, x5u points at certificates, which brings a trust chain along with it. The resource is PEM encoded, the signing certificate comes first, and each subsequent certificate certifies the one before it. RFC 7515 requires the same protection on the fetch as jku: a protocol with integrity protection, meaning TLS with a validated server certificate.
The forgery route is identical. An attacker publishes a self signed certificate, points x5u at it, and a verifier that downloads and uses the key inside validates the attacker's token perfectly. The presence of a certificate makes this feel more official than an embedded raw key, which is precisely why it slips past review more easily than jwk does.
The request forgery risk is identical too. A URL from an untrusted token becomes an outbound request from a backend host, which is how internal services and cloud metadata endpoints get reached from outside. Neither problem is solved by the certificate: a certificate is only meaningful once its chain has been validated to a trust anchor you configured, and its subject checked against the issuer you expected.
That final check is the one most often skipped. Validating the chain to a public trust anchor proves somebody obtained a certificate, not that this issuer signed your token, so the subject or a pinned thumbprint has to be checked as well. Most deployments do not need any of this: put the key set location in configuration. The decoder does the equivalent, taking the PEM public key from you and never following a URL from a header.
Examples
{ "alg": "RS256", "typ": "JWT",
"x5u": "https://auth.example.com/certs/signing.pem",
"x5t#S256": "bwcK0esc3ACC3DB2Y5_lESsXE8o9ltc05O89jdN-dg2" }
// Resource at that URL, signing certificate first
-----BEGIN CERTIFICATE-----
...signing certificate...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...issuing CA certificate...
-----END CERTIFICATE-----Things that catch people out
- Validating the chain and stopping there. A valid chain says a certificate authority issued the certificate, not that the certificate belongs to your issuer.
- Allowing plain HTTP or following redirects. Both defeat the integrity protection RFC 7515 requires for the fetch.
- Fetching before any other check. Parse and reject on issuer and algorithm first, so a hostile token never reaches the network code.
Try it: JWT Decoder
Paste a token to decode the header and payload, read the claims and expiry, and verify the signature in your browser. Nothing is uploaded.
JWT Decoder
LOCAL · Browser-OnlyDecode and inspect JSON Web Tokens without sending them to a server
Related JWT claims and algorithms
All jwt claims and algorithms →jku (JWK Set URL) Header Parameter in a JWT
The jku header points at a JWK Set URL for the signing key. Why following it blindly gives an attacker both forgery and SSRF, and safe handling.
x5c (X.509 Certificate Chain) Header Parameter
The x5c header embeds the X.509 certificate chain in the token. Why it uses standard Base64 rather than Base64URL, and how a verifier must treat it.
x5t#S256 (X.509 SHA-256 Thumbprint) Header
The x5t#S256 header holds a SHA-256 thumbprint of the signing certificate. How it is computed, where mTLS bound tokens reuse the value, and what to check.
x5t (X.509 Certificate SHA-1 Thumbprint) Header
The x5t header holds a SHA-1 thumbprint of the signing certificate. How it selects a certificate, why SHA-1 here is not the usual problem, and what to prefer.
crit (Critical) Header Parameter in a JWT
The crit header lists extension parameters a verifier must understand or reject. The rules on what may appear in it, and why it fails closed by design.
iss (Issuer) Claim in a JWT
The iss claim names who issued a token. What goes in it, why validators compare it byte for byte, and how the decoder displays it.
Tools for this
- JWT Decoder Free online JWT decoder - decode and inspect JSON Web Tokens without sending them to a server