Part 12 of 17 · 1 min read
How to build it so it holds up
- Say which transport and whether authorization applies, because stdio takes credentials from the environment, not OAuth.
- Validate every token five ways, because any one skipped check is a specific, exploitable hole, not a general weakening.
- Never pass a client's token to an upstream API, because that is exactly what token passthrough and the confused deputy attack both exploit.
- Challenge with the minimum scope and step up on demand, because a broad first challenge multiplies a stolen token's blast radius for no benefit to the honest case.
- Take the caller from the verified token, never from an argument, because an argument is something the model (or an attacker's text) can set.
- Guard every URL a stranger named, because SSRF and DNS rebinding both rely on your own client fetching from your own network position.
- Tie approval to data flow, not to wording, because a content-based control has a blind spot a paraphrase will eventually find.