Summary
Crater's Notes functionality does not consistently verify that the authenticated user belongs to the company associated with a target note. An authenticated user who can access the application may therefore read, modify, or delete another company's note by referencing its identifier.
Affected context
The issue occurs in Crater's NotesController and NotePolicy when show, update, or destroy actions operate on a note identified by ID. These actions authorize broad Bouncer abilities without passing the target Note model, and the policy does not perform the company-ownership comparison used by related policies. Company scoping is applied to the listing path but not consistently to these individual-object operations.
Exploit preconditions
- Attack surface: Authenticated NotesController endpoints for viewing, updating, or deleting notes
- Required access: A valid application account with access to the relevant general Notes abilities
- Trigger point: A request that targets a note by its identifier
- Why exploitation is possible: Authorization checks evaluate blanket abilities rather than the target note's company ownership, while object-level company scoping is absent from these actions
Why this happens
The underlying flaw is an object-level authorization failure associated with CWE-639. The controller authorizes broad actions without supplying the target model, and the policy checks whether the user has a general ability instead of verifying that the note belongs to the user's company. As a result, possession or discovery of another note's identifier can bypass the intended tenant boundary.
Potential impact
- An authenticated user may read notes belonging to another company
- An attacker could modify cross-company note content
- An attacker could delete notes outside their authorized tenant
- Confidential business information could be disclosed or altered
- Cross-tenant data integrity and isolation could be weakened
General mitigation guidance
Mitigation generally centers on enforcing object-level authorization for
every note operation.
Defensive patterns include:
- Pass the target Note model to authorization checks for show, update, and destroy actions
- Require an explicit company-ownership or tenant-membership comparison in the policy
- Apply company scoping consistently to both collection and individual-object queries
- Prefer deny-by-default authorization when tenant context is missing or ambiguous
- Limit account permissions according to least privilege
- Avoid relying on identifiers alone as evidence of access rights
- Add authorization tests covering cross-company read, update, and delete attempts
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying authorization calls that omit the target model
- Code review checks comparing sibling policies for consistent tenant-ownership enforcement
- Searches for controller actions that load records by ID without tenant-scoped queries
- Tests that attempt object access across company boundaries
- Policy enforcement requiring every object-level mutation and read to evaluate tenant context
- Automated application security testing focused on identifier substitution and horizontal access control

