CWEweakness
CWE-117 Improper Output Neutralization for Logs
Medium
Official page ↗
- Alternate terms
- Log forging
- Abstraction
- Base
- Structure
- Simple
- Status
- Draft
- Likelihood of exploit
- Medium
- Languages
- Not Language-Specific, Python
- CWE version
- 5.0
Description
The product constructs a log message from external input, but it does not neutralize or incorrectly neutralizes special elements when the message is written to a log file.
Common consequences
• Integrity, Confidentiality, Availability, Non-Repudiation: Modify Application Data, Hide Activities, Execute Unauthorized Code or Commands — Interpretation of the log files may be hindered or misdirected if an attacker can supply data to the application that is subsequently logged verbatim. In the most benign case, an attacker may be able to insert false entries into the log file by providing the application with input that includes appropriate characters. Forged or otherwise corrupted log files can be used to cover an attacker's tracks, possibly by skewing statistics, or even to implicate another party in the commission of a malicious act. If the log file is processed automatically, the attacker can render the file unusable by corrupting the format of the file or injecting unexpected characters. An attacker may inject code or other commands into the log file and take advantage of a vulnerability in the log processing utility.
Potential mitigations
• [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
• [Implementation] Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.
• [Implementation] Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
Detection methods
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Observed examples
• CVE-2020-36567: Go-based HTTP framework allows log injection via an encoded carriage return (%0a)
• CVE-2006-4624: Chain: inject fake log entries with fake timestamps using CRLF injection
Related
Attack pattern · CAPEC (3)
Observed example · CVE (2)
- CVE-2020-36567 Unsanitized input in the default logger in github.com/gin-gonic/gin before v1.6.0 allows remote attackers to inject arbitrary log lines. vulnerability
- CVE-2006-4624 CRLF injection vulnerability in Utils.py in Mailman before 2.1.9rc1 allows remote attackers to spoof messages in the error log and possibly… vulnerability
Child of · CWE (2)
Referenced by CAPEC · weakness (3)
Referenced by CVE · weakness (129)
- CVE-2026-15661 IBM Concert 1.0 through 3.0.0 could allow an unauthorized user to inject data into log messages due to improper neutralization of special… vulnerability
- CVE-2026-63442 OPNsense is a FreeBSD based firewall and routing platform. vulnerability
- CVE-2026-109786 In fail2ban 0.10.5 through 1.1.1 before ddd879d, the sshd filter (config/filter.d/sshd.conf) accepts an "on <token>" suffix after the host… vulnerability
- CVE-2026-41504 OWASP Coraza WAF is a golang modsecurity compatible web application firewall library. vulnerability
- CVE-2026-76267 In Splunk Enterprise versions below 10.4.3, 10.2.7, and 10.0.10, a user that holds a role with the read_o11y_content capability could… vulnerability
- CVE-2026-85290 InvoicePlane is a self-hosted open source application for managing invoices, clients, and payments. vulnerability
- CVE-2026-6327 IBM Concert 1.0.0 through 3.0.0 could allow an unauthorized user to inject data into log messages due to improper neutralization of special… vulnerability
- CVE-2026-93421 Mesop is a Python-based UI framework that allows users to build web applications. vulnerability
- CVE-2026-11538 IBM WebSphere Application Server 9.0 and 8.5 is affected by a log injection vulnerability through crafted LTPA token cookies. vulnerability
- CVE-2026-86522 Improper Output Neutralization for Logs vulnerability in team-alembic AshAuthentication allows an unauthenticated attacker to forge… vulnerability
- CVE-2026-84439 When audit logging is enabled (zookeeper.audit.enable=true), an unauthenticated attacker can inject arbitrary fields into Apache… vulnerability
- CVE-2026-84501 An unauthenticated attacker can inject arbitrary fake log lines into Apache ZooKeeper's operational log by sending a crafted… vulnerability
- CVE-2026-16188 IBM WebSphere Application Server 9.0, and 8.5 could allow a remote attacker to inject forged log entries into the server's administrative… vulnerability
- CVE-2026-16189 IBM WebSphere Application Server 9.0, and 8.5 could allow a remote attacker to inject forged log entries into the server's administrative… vulnerability
- CVE-2026-87859 morgan is an HTTP request logger middleware for Node.js. vulnerability
- CVE-2026-14350 IBM Cloud Pak for Data System 11.3.0.2 through Interim Fix 001 could allow an unauthorized user to inject data into log messages due to… vulnerability
- CVE-2026-9736 IBM Netezza Software 11.3.0.3 through Interim Fix 002 could allow an unauthorized user to inject data into log messages due to improper… vulnerability
- CVE-2026-15603 morgan is an HTTP request logger middleware for Node.js. vulnerability
- CVE-2026-81694 openssl-encrypt (pip package, versions <= 1.4.8) fails to sanitize filenames read from untrusted drive data (outside the AES-GCM… vulnerability
- CVE-2026-81695 openssl_encrypt versions before 1.4.9 fail to escape attacker-controlled key_id values printed to stderr during decrypt auto-detection. vulnerability
- CVE-2026-81696 openssl_encrypt versions before 1.4.9 fail to sanitize terminal control characters in file metadata printed by the info command. vulnerability
- CVE-2026-54511 LogTape is an unobtrusive logging library. vulnerability
- CVE-2026-44256 Wazuh is a free and open source platform used for threat prevention, detection, and response. vulnerability
- CVE-2026-74885 openssl_encrypt versions before 1.4.0 contain a logging bug in restore_hidden_modules() that logs module counts after clearing, always… vulnerability
- CVE-2026-17481 IBM Documentation Offline 1.0.0 through 1.4.1 could allow a remote attacker to execute arbitrary code due to improper output neutralization… vulnerability
- CVE-2026-18148 IBM i 7.6, 7.5, 7.4, and 7.3 could allow a remote authenticated attacker to inject arbitrary content into Navigator log files due to… vulnerability
- CVE-2026-48083 OpenReception's appointment booking software provides an end-to-end encrypted appointment booking platform. vulnerability
- CVE-2026-62948 OpenWrt is a Linux operating system targeting embedded devices. vulnerability
- CVE-2026-12616 The /v1/upload/sbom endpoint extracts the iss claim from the attacker-supplied JWT with signature verification disabled, then interpolates… vulnerability
- CVE-2026-10745 Improper output neutralization for logs vulnerability in upKeeper Solutions upKeeper Instant Privilege Access on Windows allows Log… vulnerability
Referenced by CWE · can precede (1)
- CWE-93 Improper Neutralization of CRLF Sequences weakness
Referenced by CWE · has member (1)
- CWE-884 CWE Cross-section view
Referenced by OWASP · mapped cwe (3)
- A09:2025 Security Logging & Alerting Failures Top 10 2025
- A09:2021 Security Logging and Monitoring Failures Top 10 2021
- CS-Logging Logging Cheat Sheet Cheat Sheet