Model-checking a credential lifecycle with TLA+ and catching a redirect-handling defect
The author follows up on an earlier TLA+ post by modeling how a reading app manages stored server credentials, session tokens, and renewal after 401 responses. The hard part is editing a credential while reads are in flight, which the code handled through several fixes over five weeks. The model has seven properties, with base configs that must pass and bug-* configs that must fail. The author also explains that history-tracking ghost variables must be set on every step that could breach a property, or the bug-* config can fail by construction and miss defects. On the first run, the model exposed a real defect: a same-origin redirect fails a read outright after another read sharing the token has seen a 401, instead of renewing and retrying.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in