Log Poisoning

Cybersecurity Glossary APIs & Server-Side Security

Log Poisoning

An attack technique where malicious code is injected into log files, which are then included through an LFI vulnerability to achieve code execution.

Log Poisoning is an attack technique where malicious code is injected into log files, which are then included or executed through a Local File Inclusion vulnerability or similar mechanism, resulting in code execution.

How It Works

Applications write various data to log files, including user-controlled input like User-Agent headers, usernames, or error messages. If an attacker can inject code into these logs and then trigger the log file's inclusion, the injected code executes.

Prevention

  • Sanitize all data before logging
  • Prevent LFI vulnerabilities
  • Run web server with restricted permissions
  • Store logs outside web root

See Also