Skip to content
vaultocean
Field
criticalAuthentication
5 min read2026-06-09

JWT alg confusion: forging tokens by switching RS256 to HS256

AN

anon

security researcher · vault ocean

The public key, served at a well-known endpoint, was accepted as an HMAC secret when the alg header was changed.

The verifier trusted the token's own alg header. Switching RS256→HS256 and signing with the public key produced a token the server accepted. Fix: pin the expected algorithm server-side; never let the token choose.

You read it — record it

sign in to record this and keep your streak alive

Reading earns +25ƒ and keeps your streak alive.

Discussion · 0

Loading…

Sign in to leave a comment.

AN

Written by

anon

Security researcher · Vault Ocean contributor