The refresh logic begins with a good intention. The access token expires, the app asks for a new one, and the user avoids logging in every five minutes. This is civilized. But the danger starts when refresh has no single owner, or no retry budget, and no single failure state. This is when the API may return 401, the client refreshes, refresh fails, and the original request retries again. Another 401 arrives, another refresh starts. Suddenly the application is performing a tiny, disturbing denial-of-service attack against itself. So refresh extends the trust, so it needs controls. Rotation, relocation, retry limits, and clean path to re-authentication.
The next failure is the one that makes security people stop smiling. Permission leaks. They happen when old authority survives after authority should have changed. And a user was, for example, an admin yesterday. Today they are a viewer. The client still shows the admin area, the token still carries an old claim, and a cached response still exposes something sensitive. The client can improve the experience and make the UI nicer, but the protected action belongs to the server, and the API serving the data or executing the action has to enforce the current permission model. Otherwise, the UI becomes theater, and the server becomes a very important and expensive stage prop.
So now let's connect these failure modes into one production-shaped incident. This is what I call the small change that moved the boundary. The incident I care about here starts with a small diff. This is a PR exert, and someone just adjusts a route guard. They change refresh behavior. Someone else moves a permission check because the UI already handles it. Someone other changes password reset and forgets the existing sessions. The pull request looks harmless because the line count is small. The production input comes from the trust decision that changed. A trust boundary is measured by what the change now allows and what it preserves, what it removes, and what it stops enforcing. So during the investigation, I would ask what authority did this change create? What did we preserve? What did we remove? And maybe left behind? In the broken version, you can see the system disagree with itself. So let's see this broken demo. In this broken mode, focus on the disagreement rather than the UI.
Comments