Inspection Reports Are Returned Without Checking Ownership
Level 2 · node · Security · Missing owner authorization on private report reads
Scenario
A fictional facility inspection service stores reports per site and records an owner for each report. Reports should be private to their owners, but another user at the same site can read a report if they know its ID. Trace the repository, service, and controller to find the missing access check.
Requirements
Return report content only when the requester matches the stored owner. Preserve site isolation, rejection of unknown reports and empty requesters, and successful reads by owners.
Acceptance criteria
- The owner can read their own inspection report.
- Another user at the same site cannot read a private report.
- A report ID from another site does not resolve to this report.
- Unknown reports are rejected.
- An empty requester identifier is rejected.
- Reports belonging to different owners remain independent.