Standing approvals: the use count saturates (v0.16.1) #20

Merged
mnovak merged 1 commits from fix/standing-count into main 2026-11-11 16:19:56 +01:00
Owner

Found by an independent read-only review of PR #19.

What: signing_sign counted a standing approval's use with += 1. uses is not bounded when a vault is read, so a stored count of u64::MAX made the next standing signature panic in a debug build (after the audit entry was written, before the signature was returned) and wrap to 0 in release. Now saturating_add. Reaching it needs the vault key.

Test: a_rule_whose_count_is_at_its_end_still_signs (unit, security.rs). Not seen red: the panic exists only in debug builds and the suite was run in release. Workspace: 241 passed, 0 failed.

Self-review: one line of behaviour; version 0.16.1. Other findings of that review are in the app (mnovak/Custos), not here. Not changed: on a hands-off vault an unattended signature counts as the key having signed before; SIGNING.md says approved entries count, which is what the code does.

Found by an independent read-only review of PR #19. **What:** `signing_sign` counted a standing approval's use with `+= 1`. `uses` is not bounded when a vault is read, so a stored count of u64::MAX made the next standing signature panic in a debug build (after the audit entry was written, before the signature was returned) and wrap to 0 in release. Now `saturating_add`. Reaching it needs the vault key. **Test:** `a_rule_whose_count_is_at_its_end_still_signs` (unit, security.rs). Not seen red: the panic exists only in debug builds and the suite was run in release. Workspace: 241 passed, 0 failed. **Self-review:** one line of behaviour; version 0.16.1. Other findings of that review are in the app (mnovak/Custos), not here. Not changed: on a hands-off vault an unattended signature counts as the key having signed before; SIGNING.md says `approved` entries count, which is what the code does.
mnovak added 1 commit 2026-11-11 16:19:50 +01:00
mnovak merged commit 61b98ee9b0 into main 2026-11-11 16:19:56 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/CustosPublic#20