At a glance
- Controls
- CWE-532 · A09: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.
- 01Read the logging code to find where requests, headers and objects are written out.
- 02Sign in as a test user and run sign-in, password reset and a test payment with marked test values.
- 03Search the logs the team shares for those marked values and report each place they appear.
Logs must not contain secrets, tokens or payment data.
Executable checkas 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
- 01
Add a redaction filter in the logging library for tokens, passwords, card data and personal fields.
- 02
Log chosen fields by name and stop logging whole request bodies or objects.
- 03
Limit who can read logs and set a retention period.
- 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? →