# Excessive Data Exposure
> An API returns more fields or records than the client needs, trusting the client to filter what's shown. It is the read side of OWASP API3:2023 (BOPLA): object-level authorization passes, but no per-property check filters sensitive fields before serialization.
## How it works
- Frameworks serialize whole objects by default: `render json: @user`, `res.json(user)`, FastAPI returning a model directly, Jackson/Marshmallow/`JSON.stringify()`. Every accessible column goes out unless a filter is configured.
- The UI shows a username; the API response behind it also carries `email`, internal IDs, `email_verification_token`, `password_reset_timestamp`, `is_admin`, `account_flags`, or session tokens. The gap between what's rendered and what's returned is the bug.
- **GraphQL amplifies it:** clients request fields explicitly, so any field defined in the schema is readable unless a resolver enforces field-level authz. See [[GraphQL Authorization Flaws]].
- It often chains: leaked internal IDs feed [[BOLA in APIs]]; leaked emails feed enumeration; leaked OTPs give [[Account Takeover]].
## Techniques / payloads
- **Inspect the raw response, not the UI.** Proxy the app, send the loading request to Repeater, and read every field the JSON carries. The interesting data is what the frontend discards.
- **Reconstruct endpoints from clients.** Decompile mobile apps to find undocumented endpoints and their full schema (vAPI api3: `POST/GET /api3/comment` returned a `deviceid` field, found only in the APK).
- **Diff across roles and records.** A field present for every role, or data for users who never interacted with the feature, signals over-exposure.
- **Walk sequential IDs / unauthenticated access.** If the record endpoint doesn't enforce auth at the endpoint (only in the navigation flow), request it directly and increment the ID.
- **GraphQL:** introspect the schema, then request sensitive fields (`salary`, `creditScore`, `token`) directly.
## Notable cases
- **vAPI api2.** `GET /vapi/api2/user/details` returned a JSON array of *every* user — id, email, address and each user's own session `token` — regardless of which valid token was sent. Those tokens could be replayed for direct ATO.
- **Online training platform ($reward).** `POST /api/v1/discussions/loadStreams.do` returned a `usersInfo` array with full emails and internal IDs for everyone *enrolled* in a course, not just discussion participants — learners, trainers and admins. A fresh unverified account enrolled in free courses harvested 14,000+ unique emails.
- **AI freelance marketplace.** `GET /api/developer/profile-details?id=22861&devId=20939` loaded with no auth when hit directly and used a sequential integer ID; the endpoint served ~19,990 user profiles' PII. Auth was enforced at the navigation layer, not the endpoint.
- **Tata nexarc.** The login API `CheckForUsersRegisteredWithEmailOrMobileNoAndSendOTP.do` returned an `otpGeneratedForMobile` field (AES-encrypted client-side, readable at a JS breakpoint). Copying the OTP from the response gave ATO, including an admin account on Tata Business Hub. Fixed by removing the field.
- **Twitter (2022, $5,040).** A pre-auth login-flow step resolved an email/phone to a user ID without consulting the discoverability setting, mapping contacts to accounts at scale.
- **snowpick / ServiceNow.** Public widgets and the Table REST API returned backend records (e.g. `sys_user`) to a public session where ACLs on one path were loose.
- **USPS Informed Visibility (~60M accounts).** A search API honored wildcard terms; shared data points (one street address) surfaced every linked account in one query ([[raw/medium.com/the-wildcard-parameter-that-exposed-60-million-usps-accounts-15889|USPS]]).
## Defenses
- **Serialize explicitly.** Build response DTOs field by field (`UserPublicSchema`) instead of returning ORM entities. Map internal objects to external contracts through transforms that evaluate the caller's permissions per field.
- **Field-level authz.** GraphQL resolvers check read access per field and return null/error otherwise. REST uses projection queries (name columns, never `SELECT *`).
- **Validate outbound payloads** against a declared schema before sending, to catch drift.
- **Enforce auth at the endpoint**, never only in the client flow. Classify property sensitivity (public/internal/confidential/restricted) and drive inclusion from the caller's context.
## Related
- [[API Security]]
- [[OWASP API Security Top 10]]
- [[Mass Assignment]]
- [[BOLA in APIs]]
- [[API Discovery]]
- [[GraphQL Authorization Flaws]]
- [[Account Takeover]]
- [[Backend-as-a-Service Data Exposure]]
See also: [[CORS Misconfiguration]]
## Sources
- [[raw/paloaltonetworks.com/what-is-broken-object-property-level-authorization-4907|What Is Broken Object Property Level Authorization?]]
- [[raw/bilal423.medium.com/api-p-2-how-to-find-excessive-data-exposure-using-postman-and-burp-sui-13021|API-P-2: How to Find Excessive Data Exposure Using Postman and Burp Suite]]
- [[raw/medium.com/exploiting-all-10-owasp-api-security-risks-in-vapi-bonus-arena-challen-14687|Exploiting All 10 OWASP API Security Risks in vAPI (+ Bonus Arena Challenges)]]
- [[raw/medium.com/one-api-request-exposed-14-000-email-addresses-15080|One API Request Exposed 14,000+ Email Addresses]]
- [[raw/infosecwriteups.com/how-an-unauthenticated-api-endpoint-exposed-19-990-user-records-11496|How an Unauthenticated API Endpoint Exposed 19,990 User Records]]
- [[raw/eaton-works.com/tata-s-b2b-platform-returned-otps-in-api-responses-11700|Tata’s B2B platform returned OTPs in API responses]]
- [[raw/masimshahzad.medium.com/twitter-privacy-bypass-hidden-accounts-found-by-email-15230|Twitter Privacy Bypass: Hidden Accounts Found by Email]]
- [[raw/bishopfox.com/introducing-snowpick-testing-servicenow-for-public-data-exposure-10406|Introducing snowpick: Testing ServiceNow for Public Data Exposure]]
- [[raw/infosecwriteups.com/from-user-enumeration-to-pii-exposure-chaining-two-apis-into-a-2-000-b-10557|From User Enumeration to PII Exposure: Chaining Two APIs Into a $2,000 Bug]]
- [[raw/medium.com/the-200-ok-that-hands-over-someone-else-s-data-13716|The 200 OK That Hands Over Someone Else’s Data]]
- [[raw/medium.com/the-wildcard-parameter-that-exposed-60-million-usps-accounts-15889|The Wildcard Parameter That Exposed 60 Million USPS Accounts]]