The invoice PDF download looks the file up by invoice number only. Invoice numbers are sequential, so another customer's PDF is easy to fetch.
Evidence: Confirmed in the Postman runner and by direct reproduction with an invoice whose PDF existed. In the final run no new PDF was generated (DEF-013), so the download returned 404 and the test passed.
Steps to reproduce
- An invoice that belongs to customer A is chosen.
- Customer B, with no link to A, requests that invoice's PDF with their own token.
- Expected
- 403 or 404, with no file.
- Observed
- 200 with application/pdf, 11,376 bytes, containing customer A's billing data.
- Impact
- The name, address, products and total of any customer can be downloaded by anyone with an account.
- Probable cause
- The download searches by invoice number and does not check the owner, unlike the single-invoice read.
- Suggested fix
- Look the invoice up by number and owner (except for the admin), and return 404 otherwise.
- Linked tests · Retest
- T-J03 · not yet retested