Excessive Data Exposure
APIs that return passwordHash and internal flags — filter responses. Lab :8816.
Visual · api_excessive_exposure
Return least data. Original Cyberlium.
If the client does not need it, do not send it.
Excessive data exposure returns full objects and relies on the UI to hide fields. Attackers call the API directly. Shape public DTOs.
1. Symptoms
/users/me returns passwordHash, reset tokens, internal flags.
Mobile apps often reveal more than web UIs.
Command guide
Try these commands — Symptoms
═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)
TLS inspection — https://www.openssl.org/docs/manmaster/man1/openssl-s_client/ Data exposure — https://owasp.org/API-Security/editions/2023/en/0xa3-broken-object-property-level-authorization/
═══ INSTALL ═══
Linux (Debian/Ubuntu):
Command — copy this
sudo apt install curl sudo apt install jq sudo apt install openssl
macOS:
Command — copy this
brew install jq
Windows: Built-in (PowerShell: Invoke-WebRequest)
Command — copy this
choco install jq choco install openssl
═══ LINUX / macOS ═══
Command — copy this
curl -sS -H "Authorization: Bearer userA" http://127.0.0.1:8816/users/1 | jq 'keys' echo | openssl s_client -connect 127.0.0.1:443 -servername localhost 2>/dev/null | openssl x509 -noout -subject -dates 2>/dev/null || echo | openssl s_client -connect example.com:443 2>/dev/null | openssl x509 -noout -subject -issuer | head -2
Primary tools to practice this lesson: curl, jq, openssl. Reference sites: TLS inspection (https://www.openssl.org/docs/manmaster/man1/openssl-s_client/); Data exposure (https://owasp.org/API-Security/editions/2023/en/0xa3-broken-object-property-level-authorization/). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.
2. Fix
Response allowlists / serializers. Different DTOs per audience.
Never rely on client filtering.
3. Lab review
Pretty-print YOUR /users/me. Confirm sensitive fields absent.
Do not dump stranger APIs looking for hashes.
4. What you ship: response DTO discipline
Least data in responses. Lab review notes.
5. What you record before the next lesson
Fields present/absent on YOUR /me.
6. Wrong vs right: stranger APIs vs literacy on systems you own
Worked failure — same API word, opposite target. Right never needs a live shop or classmate token.
- Wrong: Scrape production /me for hash practice.
- Right: Review lab DTO. Next: allowlists.
Mission: review response fields
1) GET /users/me on lab. 2) List fields. 3) Mark any that should not be public.
Stuck? Ask Cyberlium AI Mentor
Ask Mentor: “Examples of fields that must never ship?”
APPLY: passwordHash in /me is:
APPLY: True or False: UI hide fixes API exposure.
APPLY: Fix uses:
Allowlists for Responses
Part of API Security with AI — Mass Assignment and Data Exposure.
Exposure Lab — Overpost and Overshare
Part of API Security with AI — Mass Assignment and Data Exposure.
Quiz — Mass Assignment and Exposure
Part of API Security with AI — Mass Assignment and Data Exposure.