fix(security): allowlist auditLog/collaborator/shareLink repo writes (P4.5/#53) - #57
Merged
Merged
Conversation
Assisted-by: Claude Code (Sonnet) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…53) Assisted-by: Claude Code (Sonnet) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #53
Summary
Extends the
pick()write-field allowlist (from P4.3) to the last three repositories that spread...datainto Prisma. Mostly defense-in-depth, but the audit path was a genuine gap.audit.js:33callscreateAuditLog({ ...req.body, userId }), a raw client-body spread. Audit-chain integrity fieldshash/previousHash(andid) were client-injectable. Now allowlisted, so a client can no longer forge audit-chain hash fields. (The seed writes these directly, bypassing the repo, so nothing legitimate breaks.)inviteCollaboratornow allowlists; blocks client-setcollaboratorUserId/status/acceptedAt. Dedicated lifecycle updaters (accept/revoke/role) untouched.createShareLinknow allowlists; blocks client-setrevokedAt/revokedBy/lastAccessed*. Revoke/increment updaters untouched.Red-first / tests
Red
c39a0cc(each repo accepts an unallowlisted field: audit hash, collaborator collaboratorUserId, shareLink revokedBy) → greenf83d21b.Verification
server/npm test: 240 passed (237 + 3), including full collaborators/share-links API suites (accept/revoke/role/access flows intact).Gates
/simplify+/security-review+/code-reviewvia fresh cold reviewer: complete & correct, no functional regression (verified no server path writes any excluded field through these repos; dedicated lifecycle updaters unaffected). No findings.Assisted-by: Claude Code (Fable orchestrator + Sonnet implementer/reviewer)