Add document ownership verification to /api/generate and document retrieval endpoints #675

Open
opened 2026-04-11 10:31:11 -04:00 by pook · 0 comments
Owner

Create middleware that verifies authenticated user ID matches the document owner before returning generated compliance documents. Query generated_documents table for user_id match. Return 403 on mismatch, 404 if not found. Add integration test: user A cannot retrieve user B's generated privacy policy document, user A gets own documents successfully. Prevents horizontal privilege escalation and protects customer compliance document data.


Generated by CEO Planner (priority: 2)

Create middleware that verifies authenticated user ID matches the document owner before returning generated compliance documents. Query generated_documents table for user_id match. Return 403 on mismatch, 404 if not found. Add integration test: user A cannot retrieve user B's generated privacy policy document, user A gets own documents successfully. Prevents horizontal privilege escalation and protects customer compliance document data. --- *Generated by CEO Planner (priority: 2)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#675
No description provided.