My System Was Not Hacked, but the Data Still Leaked
Data leaks do not always start with a hacker. They can start with logs, analytics, configuration, or casual assumptions.
0xNN · · 8 min read
I once looked for the attacker after finding user data where it should not have been. There was no dramatic exploit. The data had travelled through a debug log, entered an analytics service, and stayed there longer than we realized.
The system was not hacked. We had simply told too many systems too much.
console.log(response) can contain email addresses, internal IDs, or tokens. A dashboard screenshot can end up in an issue tracker. Error monitoring can capture request bodies. A third-party script can receive identifiers in a URL. Each looks small; together they form a detailed trail.
Start by mapping every place data leaves the application boundary: logs, analytics, crash reporting, email, backups, staging, and browser storage. Redaction should be the default. An allowlist of fields that may be logged is safer than a blacklist of secrets that someone will eventually forget to update.
Privacy is a technical decision. Define what is needed, how long it is kept, who can access it, and how deletion works. “It might be useful later” is not a retention policy.
Most leaks are not caused by one brilliant attacker. They happen because many small systems are trusted too casually. Collect less, limit access, and test your logs as seriously as your endpoints.
---
Audit where data goes, not only who gets in
Threat models often focus on incoming requests. Data frequently leaks through paths considered internal: log aggregation, observability vendors, CSV exports, backups, and staging environments. Each has its own permissions, retention period, and audience.
Create a simple data inventory. For every sensitive field, record its source, destination, retention, owner, and redaction rule. Sample production logs periodically with restricted access. Do not wait for an annual audit to find an email address inside an error message.
Treat third-party scripts as recipients of data. Send only the events they need. Never put raw emails, tokens, or identifiers in URLs; URLs can appear in history, referrers, analytics, and proxy logs.
When a leak is found, rotate credentials that may have been exposed, remove unnecessary copies, and document the timeline. Deleting one log line is not a fix. Find why the data entered that system and add a test or lint rule so the pattern is caught earlier.
Privacy is not a legal-page feature. It is a default system behavior.
Sources
• https://owasp.org/www-project-top-ten/
• https://www.nist.gov/privacy-framework
• https://gdpr.eu/article-5-how-to-process-personal-data/