Web Application Security · intermediate · ~12 min
Audit security headers/CORS and recognise the common JWT flaws.
Missing security headers (CSP, HSTS, nosniff, frame-ancestors) are easy findings. CORS bugs come from reflecting arbitrary Origins with credentials. JWT flaws: alg:none, RS256→HS256 confusion, weak HMAC secrets, unchecked expiry, secrets in the (unencrypted) payload. Fixes: allowlist origins; pin alg, verify signature, validate claims.
These are some of the most common web findings: header gaps weaken defence-in-depth, credentialed-CORS reflection exposes authenticated data cross-origin, and JWT mistakes allow outright authentication bypass via forged tokens.
Headers. CSP (anti-XSS), HSTS, nosniff, frame-ancestors. CORS bug. Reflecting Origin + Allow-Credentials → cross-origin auth read; allowlist instead. JWT. alg:none, alg confusion, weak secret, unchecked exp, payload is base64 not encrypted. Fix. Pin alg, verify, validate claims.
A grab-bag of high-frequency findings around headers, cross-origin policy, and tokens.
CORS controls which origins may read cross-origin responses. The dangerous mistake is reflecting the request Origin back in Access-Control-Allow-Origin together with Allow-Credentials: true — any site can then make authenticated cross-origin reads. * with credentials is forbidden by browsers; reflecting arbitrary origins is the real bug. Allowlist exact trusted origins.
JSON Web Tokens are signed claims (header.payload.signature). Common flaws:
alg: none — token accepted with no signature → forge any claims.exp/aud/iss, never trust an unverified token.Header hygiene, correct CORS (allowlist, never reflect-with-credentials), and sound JWT verification (pinned algorithm, verified signature, validated claims, no secrets in the payload) close a cluster of frequent, sometimes auth-bypassing, web flaws.