Cyberlium
Cyberlium
Cyberlium on Android·Google Play Store

Learn cybersecurity with hands-on labs and AI mentor support on your phone.

Mod 7 · Les 2/5
In progress
Module 7•Lesson 2 of 5•⏱️ 15 min read•Beginner+39 XP

Excessive Data Exposure

APIs that return passwordHash and internal flags — filter responses. Lab :8816.

Excessive Data Exposure
00:00/02:16

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.
Hands-on Exercise

Mission: review response fields

1) GET /users/me on lab. 2) List fields. 3) Mark any that should not be public.

Pro Tip

Stuck? Ask Cyberlium AI Mentor

Ask Mentor: “Examples of fields that must never ship?”

Practice QuizQuestion 1
Multiple choice
Q1

APPLY: passwordHash in /me is:

Practice QuizQuestion 2
True or False
Q2

APPLY: True or False: UI hide fixes API exposure.

Practice QuizQuestion 3
Multiple choice
Q3

APPLY: Fix uses:

←Previous: Mass Assignment
Answer 3 practice quiz questions to unlock XP reward. (0/3 answered)
Skip quiz & read next →