BaseDraft
CWE-117Improper Output Neutralization for Logs
Category: other
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· 1
- Integrity / Confidentiality / Availability / Non-Repudiation — Modify Application Data, Hide Activities, Execute Unauthorized Code or CommandsInterpretation 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· 3
- [Implementation]
- [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.
Related CAPEC attack patterns· 3
References
Exploits (incoming)3
| Type | Target | Confidence | Tier |
|---|---|---|---|
| AttackPattern | Web Server Logs Tamperingcapec-81 | 100% | live |
| AttackPattern | Log Injection-Tampering-Forgingcapec-93 | 100% | live |
| AttackPattern | Audit Log Manipulationcapec-268 | 100% | live |
Compliance frameworks addressing this (incoming)1
| Type | Target | Confidence | Tier |
|---|---|---|---|
| ComplianceControl | dora-art17 | 100% | live |
(incoming)3
| Type | Target | Confidence | Tier |
|---|---|---|---|
| Vulnerability | CVE-2025-41429cve-2025-41429 | 0% | live |
| Vulnerability | CVE-2025-57564cve-2025-57564 | 0% | live |
| Vulnerability | CVE-2026-25548cve-2026-25548 | 0% | live |
Related by meaning· 6
Nearest entities by semantic similarity across the cs-graph corpus.