You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make secret removal conditional on the version read and audit only the actual deletion #349
Secret removal reads metadata, then deletes by id and organization without checking the version or affected row count. A rotation by another authorized account between those statements can replace v1 with v2; removal then deletes v2 while reporting metadata for v1. Concurrent removals can similarly report a deletion that no longer took place.
The account locks serialize mutations by the same user, but different authorized users lock different rows. The enclosing transaction does not lock the secret row during the initial read. This is an integrity/audit race, not secret disclosure or a permission bypass.
A local test of the actual store with interleaved mocked persistence observed deletedVersion=2 and returned/auditedVersion=1. A concurrent PostgreSQL reproduction is still needed; the mock result must not be presented as such.
Acceptance criteria
Use a version condition and check the affected row count, or an equivalent serialization strategy.
With real PostgreSQL and two different authorized accounts: pause removal after reading v1, commit v2, resume removal; it must return a conflict and preserve v2, without a deletion audit event.
Two simultaneous removals must produce only one successful deletion and the corresponding single audit event.
Preserve atomicity of the state change and its audit event, including rollback on audit failure.
Activity