CSE Roadmap

Core tier · about 9 hours · 17 parts

Part 14 of 17 · 2 min read

Mistakes that undercut an authorisation design

Common mistakes, and what the example does not do.

  • Skipping the audience check because everything seems to work without it. Symptom: a token issued for a different service is quietly accepted. Cause: nothing about the request looks wrong until a token meant elsewhere is reused here. Fix: check aud against this server's own canonical address on every request, unconditionally.
  • Offering the whole scope catalogue in the first challenge. Symptom: an administrator's very first token carries every permission the server has. Cause: it feels convenient to avoid a second round trip. Fix: challenge with the minimum, and let 403 insufficient_scope ask for more only when a call actually needs it.
  • Trusting a phrase blocklist as if it were complete. Symptom: a paraphrased instruction slips through untouched. Cause: a blocklist can only name the wordings someone has already seen. Fix: add a control built on data flow (what has been read, where it could go) that does not depend on wording at all.
  • Hand-parsing IP addresses to decide what's internal. Symptom: a decimal-encoded or hex-encoded loopback address sails past a string check that only recognises the plain dotted form. Fix: resolve to one canonical form with the standard library's real IP parser before deciding anything.
  • Checking an address, then re-resolving the name before connecting. Symptom: DNS rebinding reaches an internal machine even though the guard "checked" the address. Fix: pin -- connect to the exact address you just checked, never to a fresh lookup.

What the example does not do

These experiments run offline in one process, with a scripted model, a scripted approver, and a single shared signing key instead of real public-key signatures. The numbers show where each control stops a fixed set of attacks when the model is fooled, not how often a real model gets fooled on its own, and the token code is not reviewed for production use.