[PR #25] Fixing Gaps in the Sub-milestone 1 Plans
- What changed: The spec and the three plans were placed side by side, and places where expectations differed were fixed. Then the plans were reviewed from an attacker’s view, and the rate limit and responses were fixed.
- Decision: Disabling an admin, the module assignment left after withdrawal, the result when an outside service fails, and the identity check for recovery were aligned with the spec. The rate limit was changed so it cannot be bypassed with a device value.
- Still unknown: This PR fixed things against the plan documents. Whether the rate limit works on a real server will be checked after implementation.
After PR #24 was merged, I asked whether the sub-milestone 1 plans still needed review. This post records that review: the spec and the three plans were laid side by side, and the gaps were fixed. No code changed; only the spec and the plan documents were edited.
What was done and why
-
First review: places where expectations did not match. Claude laid the spec and the three plans side by side and looked for places where one side expected something the other side never provided. Four were found, and I chose the recommended fix for each.
- There was no way to turn off an admin. The spec said that switching an account to inactive ends any session it still has right away. The server plan only had a command to add an admin. A command was added that turns the admin off, ends the sessions, and writes a history record.
- A withdrawn customer still held a module assignment. Left as is, the admin screen would keep showing a withdrawn person as a linked account. The withdrawal process now records the end time of the assignment and keeps the records.
- When an outside service failed during account unlinking, the customer app plan and the server plan expected different results. I aligned them with the rule used for withdrawal: ask the outside service to unlink first, and if that fails, keep our records.
- The recovery identity check still had an old value. Three methods had been decided earlier, but the spec listed only two. I updated the spec to the latest decision.
-
Second review: an attacker’s view. I asked for the plans to be read from three viewpoints: an attacker, a field user, and a solo developer running the project. The field user and solo developer views found nothing new. The attacker view found three gaps, and I chose the recommended fix for each.
- Rate limits could be dodged with a device value. The limit was keyed on IP plus a device header, and the app sends that device value, so it can be changed. A separate per-IP limit was added.
- A verification response could reveal whether a phone number was registered. A wrong code on a registered number returned the remaining tries, but an unregistered number did not. The remaining count was removed from the response, and the app shows a fixed message instead.
- The real client IP behind the production proxy was left for “later”. It is now a task for the AWS move in sub-milestone 5, with a check on two real phones.
Options chosen and rejected
- Building a screen to turn off admins: Rejected. There are only a few admins, so one server command is enough.
- Keeping a withdrawn person’s assignment and hiding it only on screen: Rejected. Every list would have to filter them out, which is easy to miss.
- Erasing our records first during unlinking and retrying the outside service later: Rejected. A failed retry could leave the outside link alive with no way left for anyone to remove it.
- Limiting only by IP and removing the device value: Rejected. It is simpler, but the customer app plan, the privacy policy and the store data table would all need changes too. On mobile networks many people can share one IP, so the tighter limit stays keyed on the device value.
- Going back to recovery by phone call only: Rejected. That reverses a decision already made, and the server and admin web plans would need rewriting.
How it was checked
- Claude checked each row of the spec’s failure table for the command, screen or test that makes the promised action happen. The missing way to turn off an admin was found this way.
- Claude matched the withdrawal order with the module board response and confirmed that assignments were being left behind.
- For the attacker view, the review followed which values an attacker could change. Every place where the remaining count appeared was found across the repository and fixed.
- Claude made a mistake while editing: a replacement command that handled Korean text broke some characters. Claude restored the file to the last commit, made the edits again by hand, and re-checked the whole repository for broken characters.
- This change touched documents only, so there are no automated tests for it.
Lessons
- When a failure table says “we do X”, check that a command, screen or API in the plan actually does X. Checking only the test rows misses gaps.
- A response that is honest to a user can be information to an attacker. Each field in a response should be reviewed again from the attacker’s side.