CSE Roadmap

Core tier · about 9 hours · 17 parts

Part 7 of 17 · 4 min read

What the example found

Token checks, audience and scope behaviour, PKCE and mix-up attacks, the SSRF guard, and the poisoning-control grid.

How to read the token-check table: each row removes one check from the server and presents the same bad token; the result shows what got through.

Check removed What gets through Careful server says
audience a token issued for another service works here 401
signature a forged token naming bob returned every user's note titles 401
issuer a token from another authorization server 401
scope a read-only token called the administrator's export 403

What to notice: every removed check lets through a request that is specifically shaped to exploit that one gap. There is no overlap where removing one check happens to also be covered by another. That is why the module insists on checking all five rather than treating them as redundant.

How to read the scope table: each row is a step in a session that starts minimal and asks for more only when needed.

Situation Measured
First call is a read 1 authorization, token scope notes:read, statuses [401, 200]
Then a write statuses [403, 200], 2 authorizations in all, scope now notes:read notes:write, still 1 consent screen
A non-administrator asks for an admin tool the client stopped after 2 attempts; the token never gained the scope
An administrator's token calls a read tool 200: a broader scope covers a narrower one

What to notice: offering all three scopes in the very first challenge, instead of just notes:read, would have made an administrator's first token carry admin:export too. That is three times the blast radius of a stolen token, for no benefit to the honest case.

How to read the PKCE and mix-up table: each row is an attack on the flow itself, with and without its specific defence.

Attack Without the defence With it
Stolen code, no verifier refused (invalid_grant) regardless refused
Stolen code, no PKCE at all exchanged for a token n/a (PKCE removed)
Code redeemed twice refused refused
Code after 61 seconds (limit 60) refused refused
Response naming the wrong issuer accepted rejected (iss check)
Missing iss from a server that promised one accepted rejected

What to notice: PKCE and the iss check defend against two different attacks that happen to both target the authorization code. Removing PKCE breaks the stolen-code defence but leaves the iss check untouched, and vice versa. This is the detail an interview follow-up usually probes for.

How to read the SSRF table: each row is one spelling of an internal address, or one guard configuration, against the simulated network.

Guard configuration Internal address reached?
Unguarded client, plain spelling yes
Unguarded client, decimal-encoded loopback (2130706433) yes
Unguarded client, short hex (0x7f.1) yes
Unguarded client, redirect to the metadata address yes
Guarded client, any of the above no
Guarded client, ordinary public address reached normally
Guard that re-resolves before connecting (no pinning) yes (DNS rebinding)
Guard that pins the checked address no

What to notice: the guard's success has nothing to do with recognising "that looks like an internal address" by pattern. It resolves to a canonical form (one standard way of writing the address) with a real IP parser and checks that. That is why all seven disguised spellings fail the same single check instead of needing seven separate rules.

How to read the poisoning-control table: each row is a defence; columns are which of the four text-based attacks it stopped.

Control Tool poisoning Rug pull Shadowing Indirect injection
None (scripted model obeys) leaked leaked leaked leaked
Person reads whole description stopped (missed a paraphrase) n/a stopped n/a
60-character preview leaked (buried after benign text) n/a n/a n/a
Phrase blocklist stopped (missed the same paraphrase) n/a n/a n/a
Pinning (hash at approval time) n/a stopped n/a n/a
Taint-based approval stopped stopped stopped stopped

What to notice: the taint-based control is the only row with no gaps. Every content-based control (reading, previewing, scanning) has at least one blind spot, and they are different blind spots. So layering them still leaves a determined paraphrase with a way through. The structural control closes that way regardless of wording.

{{svg:poisoning|A poisoned tool description against each control, using a scripted model that obeys everything}} {{svg:ssrf|Each URL was supplied by a remote party. The guarded client resolves once, checks, and connects to what it checked}}