fix(assessment): bulk sign-off/confirm cannot bypass required-signer role or N-of-M - #41
Open
simonorzel26 wants to merge 1 commit into
Open
fix(assessment): bulk sign-off/confirm cannot bypass required-signer role or N-of-M#41simonorzel26 wants to merge 1 commit into
simonorzel26 wants to merge 1 commit into
Conversation
…role or N-of-M bulkSignOffCategory and bulkConfirmModuleRef both write a completed sign-off (status=completed, signedOffBy/signedOffRole, chain entry) for every matching requirement, but neither checked requirement.requiredSignOffRole or existing N-of-M assignments — unlike the single signOff path, which FORBIDs a non-CEO from signing a CEO-required requirement and records one signature toward the assigned quorum. So an authenticated category owner could complete the §38 CEO duties (1.3/1.4/2.4, plus module-backed 4.2/7.3) by calling the bulk endpoints instead of signOff. Neither endpoint is wired to the UI today, but both are reachable companyProcedures. Both now filter to signable rows before writing: a row is skipped if it has assignment rows (its assigned signers must each sign through the assignment flow) or if the caller's signer role does not satisfy the requirement's requiredSignOffRole — same admin-bypass rule signOff uses. The chain-write path (audit B-2) is unchanged; only the row set narrows. Pre-existing gap, surfaced by the e2e sign-off review (my specs covered only the single path). Security-sensitive: recommend Cory reviews, and a tRPC-level authz test asserting a member cannot bulk-complete a CEO-required requirement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security gap (pre-existing, surfaced by the sign-off e2e review)
bulkSignOffCategoryandbulkConfirmModuleRefeach write a completed sign-off (status=completed,signedOffBy/signedOffRole, chain entry) for every matching requirement — but neither checkedrequirement.requiredSignOffRoleor existing N-of-M assignments. The singlesignOffpath does both (assessment.ts:564FORBIDs a non-CEO from signing a CEO-required requirement; N-of-M records one signature toward the quorum).Impact: an authenticated category owner (member) could complete the §38 CEO duties — 1.3 budget, 1.4 personal liability, 2.4 risk acceptance, plus module-backed 4.2/7.3 — by calling a bulk endpoint instead of
signOff, defeating the dual-control the product's evidentiary claim rests on. Neither endpoint is UI-wired, but both are reachablecompanyProcedures (any tenant member with a session).Fix
Both endpoints now filter to signable rows before the (unchanged) write loop. A row is skipped when:
requiredSignOffRole— same admin-bypass rulesignOffuses.The audited chain-write path (B-2) is untouched; only the row set narrows. Redundant second
getSignerRolecall inbulkConfirmModuleRefcollapsed into the one the filter already computes.Review asks
Typecheck clean. Not merging without your go.
🤖 Generated with Claude Code
https://claude.ai/code/session_01De1NY1HDUJkkwetVKTbYtH