P1: Privacy Breach via Web Application Vulnerabilities
A valid login is not a key to everyone's record.
What Is P1: Privacy Breach via Web Application Vulnerabilities?
An API that confirms your session but never checks what you are allowed to see will return any record its URL names, and the whole record at that. You'll watch a logged-in account read other customers' full prescriptions by changing one number in the URL, then close the leak in code: return only the fields the screen uses, confirm each record belongs to the caller, answer a stranger's id with a 404, scope the list route to the caller's own records with a capped page, and refuse and log for review any account that makes many lookups of other customers' prescriptions.
What You'll Learn in P1: Privacy Breach via Web Application Vulnerabilities
- A valid session proves who is calling, never which records they may read; a read-by-id route must check the record belongs to the caller, and a list route must take the caller from the session and cap its page size.
- Return only the fields the screen uses, so even a correct, owned call never ships data the product never displays.
- Answer a record that is not the caller's with the same 404 a missing id gives, which closes sequential-id enumeration.
- Rate-limit and log for review an account that makes many lookups of other customers' records, so a bulk harvest is caught even when each call looks valid.
P1: Privacy Breach via Web Application Vulnerabilities — Training Steps
-
An Ordinary Customer
Pellora is an online pharmacy. Any customer can open the app and see their own prescriptions. Bob signed up as a normal customer, with a throwaway identity, to harvest health data he can resell. The prescription screen loads one record from GET /v1/prescriptions/{id} , and the ids are plain sequential numbers. Bob's own prescription is id 80412. He opens the API Tester and calls it the way the app does, carrying his own customer token.
-
More Than the Screen Shows
The call returns his own prescription, as expected. But the app's prescription screen only ever shows the medicine, the dosage and the delivery status. The API handed back a great deal more.
-
Change One Number
Bob sends the same request with the same token and changes only the id in the URL, one below his own. If the API checks that a prescription belongs to the caller, this returns nothing. If it only checks that his session is valid, it answers.
-
A Stranger's Record
It answered. Bob's own customer token just pulled a prescription that has nothing to do with him. A fertility medication is special-category health data, the kind of fact a person tells almost no one.
-
Pull the Whole Range
Reading one record at a time has no limit either, so Bob does not stop at two. He points a script at the id range and asks the same endpoint for the lot in one call.
-
Eighteen Thousand Records
One request, the whole customer base. The status bar above the response shows the size of what just crossed the wire.
-
Knowledge Check
-
The Alert Lands
You own Pellora's customer-facing API. Overnight, monitoring flagged one customer token reading thousands of prescriptions that were not its own. Security Operations has emailed you the details.
-
Open the Data Trail
Pellora keeps a data map of every system that holds a customer. Nadia Okafor is the data subject here: the person the leaked record is about. Alice opens the map to see where her prescription ended up.
-
What the Endpoint Returns
The production database is where the prescriptions API reads from. Its card lists every field a single call hands back.
Security Framework Coverage
OWASP Privacy Top 10
- P1 Web Application Vulnerabilities
OWASP ASVS
- V8.2.2 General Authorization Design
- V15.3.1 Defensive Coding
- V2.4.1 Anti-automation
CWE
- CWE-639 Authorization Bypass Through User-Controlled Key
- CWE-213 Exposure of Sensitive Information Due to Incompatible Policies
- CWE-770 Allocation of Resources Without Limits or Throttling
CIS Controls
- CIS 3 Data Protection
NIST CSF
- PR.AT-02 Individuals in specialized roles are provided with awareness and training so that they possess the knowledge and skills to perform relevant tasks with cybersecurity risks in mind
- PR.DS Data Security
NICE Framework
- DD-WRL-003 Secure Software Development
- OG-WRL-008 Privacy Compliance
GDPR
- Art. 32 Security of processing
- Art. 9 Processing of special categories of personal data
HIPAA
- 164.312 Technical safeguards