CWE-532Data exposureSeverity · Medium

Customer data in logs

Logs that keep emails, card details or access tokens. Every engineer and every log tool can then read data that should sit behind strong controls.

At a glance

Controls
CWE-532 · A09:2021 Security Logging and Monitoring Failures
Typical severityMedium
ReferenceCWE-532
OWASP Top 10A09:2021 Security Logging and Monitoring Failures

What it is

Applications often log whole requests, responses or objects to help with debugging. Those records can carry passwords, session tokens, card numbers and personal details. Logs are then copied to search tools, monitoring services and backups with much wider access than the main database.

Anyone who reaches the logs can reuse a token to act as a customer or collect personal data in bulk. Log tools are often less guarded than production systems. AI-assisted attackers who gain access to a log store can sift huge volumes quickly and pull out every usable secret.

Where it hides

What a reviewer can look for in the code and in the behaviour, before anyone proves it.

  • Request and response logging middleware
  • Authentication, password reset and payment flows
  • Error handlers that dump the full request object
  • Third-party log, monitoring and error tracking integrations

How MATT tests it

The proof runs against the deployed product, on every release, whoever wrote the code.

  1. 01Read the logging code to find where requests, headers and objects are written out.
  2. 02Sign in as a test user and run sign-in, password reset and a test payment with marked test values.
  3. 03Search the logs the team shares for those marked values and report each place they appear.
The rule, in plain English

Logs must not contain secrets, tokens or payment data.

Executable check

as user A: POST /v1/login, then POST /v1/payments with test card data search logs: the test password, session token and card number expect: zero matches expect: Authorization headers shown as [REDACTED]

Every rule MATT holds →

What the fix looks like

  1. 01

    Add a redaction filter in the logging library for tokens, passwords, card data and personal fields.

  2. 02

    Log chosen fields by name and stop logging whole request bodies or objects.

  3. 03

    Limit who can read logs and set a retention period.

  4. 04

    Purge sensitive entries that are already stored and rotate any exposed tokens.

A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →

ExploitOps discovery call

Understand where your security loop breaks.

A call with a MATT co-founder to understand your product and whether an ExploitOps Review is worth doing. If there is a real need, we scope one with the research team.

Let’s understand your priority

What brings you to MATT?

What would you like help with?
01 / 02