Headers, CORS & Data Leakage
This one is short on purpose. Headers, CORS settings, error messages and logs are the small settings nobody looks at.
Why it matters
Your app answers every request with more than the page. It sends headers that tell the browser what to trust, CORS rules that say which other sites may call your API, error messages, and it writes logs. Each of those can give something away.
None of them breaks anything when it is wrong, so you never notice. The app works, the demo works, and the leak sits there until someone reads it.
What it looks like when it goes wrong
- CORS where the server repeats back whatever Origin a request sends and allows credentials, so any website can read a logged-in user's data from your API.
- Missing security headers, so the browser has no instruction to refuse framing or to stop guessing content types.
- An error response that returns the stack trace, the query text or a table name to anyone who sends a bad request.
- Logs that quietly record emails, tokens or whole request bodies.
The logs one is not hypothetical. In 2019 Facebook said that during a routine security review it found some user passwords stored in a readable format in its internal data storage systems. It later added that it had found more Instagram passwords stored the same way in logs. Its investigation found no evidence they were abused or improperly accessed. A company that size still got caught out by it, and an app written in an afternoon is easy to catch the same way. Facebook's post, Keeping Passwords Secure.
What a proper check involves
- Read the headers your live site actually sends, not the ones your config file says it sends.
- List every origin your API allows, and whether credentials are allowed from any you do not control.
- Send your own endpoints bad input and read what comes back. A stranger should never see a stack trace, query text or a table name.
- Search what you log for personal data, then check who can read those logs.
- Fix one thing at a time and recheck, because a header fix can break a script you forgot you had.
The Kit sections that do this check
The Self-Audit Kit runs this check for you, one prompt at a time, in three sections.
- Section 4, Security headers: what your server does and does not send, and the grade you get for it.
- Section 3, API auth gaps: your CORS settings, and error responses that leak stack traces or table names.
- Section 5, GDPR and data handling: personal data in your logs.