🚀 Join our AI Wargame at Black Hat Asia and our Workshop + Wargame at NDC Sydney .


Insertion of Sensitive Information into Log File

The application writes sensitive information to log files. This may include user data, credentials, tokens, full request details, database queries, internal paths, system information, or other confidential values that should not be recorded. Logs are often accessible to a wider set of users, services, administrators, or support tooling than the original application data, making them a secondary exposure path for attackers. If an attacker gains access to application, build, debug, or error logs, they may be able to recover sensitive information and use it for account compromise, data theft, privilege escalation, or further attacks.

Remediation

Review all logging statements and remove sensitive values before writing to logs. Avoid logging credentials, secrets, tokens, session identifiers, payment data, personal information, full database queries, or complete user objects. Use structured logging with explicit allowlists, redact or mask sensitive fields, and ensure debug logging is disabled in production. Log files should also be protected with strict access controls, retention limits, and monitoring for unauthorized access.

Metadata

  • Severity: high
  • Slug: insertion-of-sensitive-information-into-log-file

CWEs

  • 532: Insertion of Sensitive Information into Log File

OWASP

  • A09:2021: Security Logging and Monitoring Failures

Available Labs

Select a language to explore available labs for this vulnerability.

No matching labs found

Try adjusting your language filter.

Deco line
Deco line

Play AppSec WarGames

Want to skill-up in secure coding and AppSec? Try SecDim Wargames to learn how to find, hack and fix security vulnerabilities inspired by real-world incidents.

Deco line
Deco line

Got a comment?

Join our secure coding and AppSec community. A discussion board to share and discuss all aspects of secure programming, AppSec, DevSecOps, fuzzing, cloudsec, AIsec code review, and more.

Read more