RFC 7518 — JSON Web Algorithms (JWA)

Implemented via github.com/golang-jwt/jwt/v5

RFC 7518 — JSON Web Algorithms (JWA)

Status: Standards Track
Published: 2015-05
L-tier / T-tier: L1 · (referenced by L1 siblings; no flow of its own)
OneAuth coverage: Implemented via github.com/golang-jwt/jwt/v5
JOSE family: JWS · JWE · JWK · JWA · JWT
See also: LANDSCAPE.md

In one sentence

JWA is the registry — the catalog of named cryptographic algorithms that
JWS, JWE, and JWK headers reference by string. It’s the “menu” the other
JOSE specs read from.

What problem does it solve?

Without JWA With JWA
Every JWS-using deployment invents its own alg string conventions One IANA-registered table; libraries everywhere agree on what RS256 means
Algorithm evolution requires re-spec’ing the parent RFC New algorithms (Ed25519, Ed448) plug into JWA without touching JWS
Implementation conformance is per-algorithm — each one has its own RFC pointer The JWA table points at the canonical RFC for every alg

JWA is a boring spec on purpose. Its boringness is its value — the algs
are defined once, tested once, and reused by every JOSE consumer.

Relatable example

Every alg field you’ve ever seen in a JWT header is a JWA value:

alg What it is Where you’ve seen it
none “Unsigned” — the famous attack vector “alg:none” CVEs across multiple libraries (~2015)
HS256 HMAC + SHA-256 (symmetric) Quick-and-dirty internal token signing; jwt.io default
RS256 RSASSA-PKCS1-v1_5 + SHA-256 Google, GitHub, most enterprise IdPs
RS384 / RS512 RSASSA + SHA-384/512 Higher-security variants of RS256
PS256 RSASSA-PSS + SHA-256 FAPI 1.0 Advanced mandates this over RS256
ES256 ECDSA P-256 + SHA-256 Smaller signatures; Apple Sign-In tokens
ES384 / ES512 ECDSA P-384/521 Higher-security variants
EdDSA Ed25519 (registered later via RFC 8037) Modern recommendation; not in original 7518 table

Key concepts

  1. alg=none is the classic footgun. When a library accepts
    {"alg":"none"} and skips signature verification, tokens are forgeable
    trivially. Defense: verifier explicitly allowlists algs; never trusts
    the header.
  2. Algorithm/key-type binding. An RS256 token requires an RSA key; an
    ES256 token requires a P-256 EC key. Mismatch (e.g., verifying an
    HS256-tagged token using an RSA public key as the secret) is another
    famous attack — fixed in libraries by hard-tying alg to key type.
  3. JWA also covers JWE algs (key wrapping like RSA-OAEP-256, content
    encryption like A256GCM). Less commonly touched in OAuth contexts.
  4. JWE’s enc parameter is separate from alg. alg is how the
    content key gets wrapped to the recipient; enc is how the payload
    itself is encrypted. Both live in JWA.
  5. Vendor profiles often restrict the allowed set. FAPI 1.0 Advanced
    forbids RS256 in favor of PS256. Internal services may forbid
    HS256 and require asymmetric algs to avoid shared-secret hazards.

Wire example

JWA appears only as fields in other JOSE structures. Examples:

In a JWS header:

{"alg":"RS256","typ":"JWT","kid":"..."}

In a JWK:

{"kty":"RSA","alg":"RS256","kid":"...","n":"...","e":"AQAB"}

In a JWE header:

{"alg":"RSA-OAEP-256","enc":"A256GCM","kid":"...","typ":"JWT"}

There is no “JWA wire format” — JWA is the vocabulary.

Where it lands on the OAuth abstraction

  • L1 token format. JWA underpins the other JOSE specs without ever
    appearing in its own right.
  • No T-tier. It’s referenced from T5 (issue), T7 (verify), and T0
    (publish) — but only through its siblings.

OAuth 2.0 status

Not part of bare 2.0. Universally referenced in any 2.0 deployment that
ships JWTs (which is most modern ones). The alg-confusion class of attacks
forced every JWT library and every 2.0 AS to ship algorithm allowlists in
the years after publication.

OAuth 2.1 status

Same. 2.1 doesn’t restrict algorithm choice itself — that’s left to vendor
profiles. FAPI 2.0 (L8) does restrict allowed algs.

OneAuth status

7518 surface Status Where (grep-verified) Notes
HS256 Implemented golang-jwt; used for some symmetric-key flows Never published to JWKS (keys.JWKSHandler). Since 0.1.45 an empty HMAC key never signs or verifies, and the reference server refuses a jwt.secret_key under 32 bytes
RS256 Implemented golang-jwt; default asymmetric for many deployments Published to JWKS via utils/jwk.go
ES256 (P-256) Implemented golang-jwt; smaller-signature alternative Published to JWKS
PS256 Partial apiauth/dpop.go (defaultDPoPAlgs, FAPIDPoPAlgs); apiauth/fapi2.go (fapi2AssertionAlgs) Accepted on DPoP proofs since 0.1.41, and allowed for client assertions under OneAuthConfig.FAPI2 since 0.1.54. Since issue 330 the AS signs with it (SigningAlg: "PS256" with an RSA key, so access tokens, ID tokens, JARM and userinfo are PS256), the JWKS lists the key as PS256, and a client can register a PS256 key
EdDSA (Ed25519) Partial apiauth/dpop.go (defaultDPoPAlgs); utils/jwk.go (okpJWKToPublicKey); apiauth/fapi2.go (fapi2AssertionAlgs) Ed25519 DPoP proofs are accepted by default since 0.1.43, and EdDSA client assertions are allowed under FAPI2 since 0.1.54. oneauth can’t sign tokens with EdDSA or register an Ed25519 client key (#331). sshkeys/ uses Ed25519 for SSH only
none rejection Implemented golang-jwt v5 default Algorithm allowlist guards prevent accidental acceptance
RS256-with-HS256-key-confusion guard Implemented Library enforces; OneAuth never passes a public key as a symmetric secret The classic attack is blocked by library design
RSA key size (§3.3, 2048-bit minimum) Implemented utils.CheckRSAKeySize in the PEM and JWK parsers Since 0.1.47 an RSA key under 2048 bits fails at load, including one a remote JWKS publishes

PS256 and EdDSA are accepted on DPoP proofs and FAPI 2.0 client assertions. oneauth signs with PS256 and stores PS256 client keys (issue 330). Signing with EdDSA, and registering Ed25519 client keys, are still open (#331). Under FAPI2 a client can use ES256 or PS256 assertions.

When NOT to use it

JWA itself is just a registry — you don’t choose to use it or not. The
algorithm choice is what matters:

  • HS256: convenient but the verifier needs the secret. Avoid for
    cross-org token verification.
  • RS256: long-standing default; FAPI 1.0 Advanced banned it in favor
    of PS256 due to PKCS1-v1_5 padding concerns. Still ubiquitous outside
    FAPI.
  • ES256: smaller signatures than RSA, faster verify, comparable
    security. Good default for new deployments.
  • EdDSA: modern recommendation when libraries support it; smallest
    signatures, simplest verifier, no curve-parameter footguns.
  • RFC 7515 JWS — consumes JWA’s signing algs
  • RFC 7516 JWE — consumes JWA’s encryption algs
  • RFC 7517 JWK — JWK entries carry an alg from JWA’s table
  • RFC 8037 — registered Ed25519/Ed448 into JWA after the fact
  • RFC 9468 — registered hybrid PQ algorithms (future-proofing)