Invoice export endpoint checks login but not ownership
What we found
Code review showed the invoice export handler loaded records by the ID in the request and only checked that the caller had a valid session. The SAST tool did not flag it, because nothing in the code looked unsafe on its own. Changing the ID in the request returned another customer's invoice.
Impact
Any customer can download every other customer's invoices.
How to fix it
Load records through a query scoped to the caller's account, and add a shared authorization check to every handler that takes an object ID. Add a test that requests another account's object and expects a denial.






