Skip to content

fix(security): allowlist auditLog/collaborator/shareLink repo writes (P4.5/#53) - #57

Merged
franciszver merged 2 commits into
mainfrom
fix/p4-remaining-repo-allowlist
Jul 24, 2026
Merged

fix(security): allowlist auditLog/collaborator/shareLink repo writes (P4.5/#53)#57
franciszver merged 2 commits into
mainfrom
fix/p4-remaining-repo-allowlist

Conversation

@franciszver

Copy link
Copy Markdown
Owner

Closes #53

Summary

Extends the pick() write-field allowlist (from P4.3) to the last three repositories that spread ...data into Prisma. Mostly defense-in-depth, but the audit path was a genuine gap.

  • auditLogaudit.js:33 calls createAuditLog({ ...req.body, userId }), a raw client-body spread. Audit-chain integrity fields hash/previousHash (and id) 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.)
  • collaboratorinviteCollaborator now allowlists; blocks client-set collaboratorUserId/status/acceptedAt. Dedicated lifecycle updaters (accept/revoke/role) untouched.
  • shareLinkcreateShareLink now allowlists; blocks client-set revokedAt/revokedBy/lastAccessed*. Revoke/increment updaters untouched.

Red-first / tests

Red c39a0cc (each repo accepts an unallowlisted field: audit hash, collaborator collaboratorUserId, shareLink revokedBy) → green f83d21b.

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-review via 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)

franciszver and others added 2 commits July 24, 2026 07:28
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>
@franciszver
franciszver merged commit 2d615eb into main Jul 24, 2026
2 checks passed
@franciszver
franciszver deleted the fix/p4-remaining-repo-allowlist branch July 24, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P4.5: Apply write-field allowlist to auditLog/collaborator/shareLink repositories (defense-in-depth)

1 participant