Sensitive Data Exposure & Privacy

Sensitive Data Exposure & Privacy

Most data leaks are not dramatic breaches; they are everyday over-sharing. An API returns the whole user object when the screen needs two fields, personal data lands in logs or URLs, or sensitive values sit in the browser's storage. Each is quietly recoverable by anyone with access to that surface, and each carries real regulatory weight under GDPR and similar laws.

Excessive Data Exposure (Over-Fetching)

CWE-213OWASP API3:2023
What it is
An endpoint returns full objects, including fields the client never uses, relying on the UI to hide them.
Why it matters
Sensitive fields (emails, tokens, internal flags) are trivially readable in the raw API response.
How to check
Return only the fields each view needs; shape responses on the server rather than filtering in the client.

Unauthenticated Access to Personal Data

CWE-306GDPR Art.32
What it is
An endpoint that returns personal data is reachable without authentication.
Why it matters
Public exposure of customer PII, often discoverable by crawlers and scanners.
How to check
Require authentication and authorization on every endpoint that touches personal data.

PII & Secrets in Logs, URLs, and Errors

CWE-532
What it is
Personal data, tokens, or secrets are written to logs, embedded in URLs, or returned in error messages and stack traces.
Why it matters
Sensitive data spreads to log stores, analytics, and browser history where it is retained and widely accessible.
How to check
Redact sensitive values before logging, keep them out of URLs, and return generic errors to clients.

Sensitive Data in Client Storage

CWE-922
What it is
Tokens or personal data are stored in localStorage, sessionStorage, or non-HttpOnly cookies.
Why it matters
Any script on the page, including a compromised dependency, can read the stored secrets.
How to check
Keep session tokens in HttpOnly, Secure cookies and avoid persisting sensitive data in the browser.

Data Retention & Right to Erasure

GDPR Art.17
What it is
Personal data is kept with no retention limit or no working deletion path.
Why it matters
Regulatory exposure and a larger blast radius if the data is ever breached.
How to check
Implement retention limits and a verifiable deletion flow across primary stores and backups.

In-depth guides

Related coverage

Check your code for sensitive data exposure & privacy

Tethlyn Audit checks your codebase for sensitive data exposure & privacy and more, then ranks each finding by real exploitability and data sensitivity.

See Tethlyn Audit