TinyWeb Log Injection via Control Characters in Request URI

Security Advisory. Published: July 18, 2026. Fixed in TinyWeb v2.05 (July 18, 2026).

Summary

In versions up to and including 2.04, TinyWeb HTTP Server wrote request fields (such as the request URI and the User-Agent) to its access, referer, and agent log files without neutralizing control characters. A remote, unauthenticated attacker could send a request whose percent-decoded URI path contained NUL, CR, LF, other C0 control bytes, DEL, or HTAB. When reflected into a log line, embedded CR/LF could forge additional log entries (log injection / log forging), and raw control bytes could corrupt log parsers or terminals used to view the logs. Because the access log wraps the request line in double quotes, an unescaped quote could also break out of the quoted field.

Severity: Medium (CVSS 3.1 Base Score: 5.3)

Vulnerability Details

GitHub Security Advisory GHSA-wxxh-8845-3c89
Vulnerability Type Improper Output Neutralization for Logs (CWE-117), Improper Neutralization of CRLF Sequences (CWE-93)
Attack Type Remote
Attack Vector Network (unauthenticated HTTP request)
Vendor/Maintainer Maxim Masiutin
Product TinyWeb HTTP Server for Windows
Affected Versions Version 2.04 and below
Fixed Version 2.05 (July 18, 2026)
Impact Log Injection / Log Forging, Log Parser and Terminal Corruption

CVSS Score

CVSS Version Score Severity Vector String
CVSS 3.1 5.3 Medium AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Technical Details

Root Cause

TinyWeb writes user-controlled request fields directly into its access, referer, and agent log files. The request line (method, URI, and protocol) is recorded in the access log wrapped in double quotes, and the User-Agent and referer headers are recorded in their respective logs. None of these values were neutralized before being written, so any control character present in the field was emitted verbatim into the log stream.

Mechanism

An attacker sends a request whose percent-decoded URI path contains control bytes: NUL (0x00), CR (0x0D), LF (0x0A), other C0 control characters, DEL (0x7F), or HTAB (0x09). Because the path is percent-decoded before it is logged, an encoded sequence such as %0d%0a becomes a real CR/LF pair in the log line.

  • Log forging: An embedded CR/LF splits one logged request into what appears to be two log records, letting the attacker inject fabricated entries that mislead operators or log analysis tooling.
  • Parser and terminal corruption: Raw control bytes can corrupt downstream log parsers, or trigger terminal escape sequences when an operator views the log in a console.
  • Quoted-field breakout: Because the access log wraps the request line in double quotes, an unescaped " in the URI could break out of the quoted field and confuse parsers that split on quotes.

Proof of Concept

A request with a percent-encoded CRLF in the URI path forges an extra log line once decoded:

GET /page%0d%0a127.0.0.1+-+-+[injected]+"GET+/admin+HTTP/1.1" HTTP/1.1
Host: 127.0.0.1

After percent-decoding, the CR/LF terminates the genuine log record early and starts an attacker-controlled second line that mimics a legitimate request entry.

Fix Applied in Version 2.05

The problem has been patched in version 2.05. Decoded URI paths containing control characters (NUL, CR, LF, other C0 controls, DEL, HTAB) are now rejected with 400 Bad Request, and a new EscapeForLog helper encodes bytes 0..31, 127, #, ", and \ as #NN (two uppercase hex digits) for every user-controlled field written to the logs. The encoding is self-delimiting and uniquely decodable, so no attacker-supplied byte can forge or corrupt a log record.

Workarounds

If upgrading to v2.05 is not immediately possible, consider the following mitigations:

  • Treat TinyWeb log files as untrusted input.
  • View the logs with tools that render control bytes inertly rather than interpreting terminal escape sequences.
  • Do not feed the logs unfiltered into log processors that interpret CR/LF as record separators.

Timeline

July 18, 2026 Vulnerability identified by Maxim Masiutin
July 18, 2026 Fix implemented and committed to master (v2.05)
July 18, 2026 Security advisory published (GHSA-wxxh-8845-3c89)

References

Other TinyWeb CVEs

GHSA-rprm-fpv2-mwwf Socket Counter Imbalance Re-enables Slowloris (CWE-400) - Fixed in v2.05. CVSS 7.5 High. Advisory
GHSA-56x3-254q-j68q HTTP Request Smuggling via Unsupported Transfer-Encoding (CWE-444) - Fixed in v2.05. CVSS 5.9 Medium. Advisory
CVE-2026-29046 HTTP Header Control Character Injection into CGI Environment (CWE-113) - Fixed in v2.04. CVSS 8.8 High. Advisory
CVE-2026-28497 Integer Overflow / HTTP Request Smuggling (CWE-190, CWE-444) - Fixed in v2.03. CVSS 8.7 High. Advisory
CVE-2026-27633 Content-Length Memory Exhaustion (CWE-400) - Fixed in v2.02. CVSS 8.7 High. Advisory
CVE-2026-27630 Thread/Connection Exhaustion Slowloris (CWE-400) - Fixed in v2.02. CVSS 8.7 High. Advisory
CVE-2026-27613 CGI Parameter Injection (CWE-78, CWE-88) - Fixed in v2.01. CVSS 9.3 Critical. Advisory
CVE-2024-34199 Buffer Overflow (CWE-787) - Fixed in v1.99. CVSS 8.6 High. Advisory
CVE-2024-5193 CRLF Injection (CWE-93) - Fixed in v1.99. CVSS 5.3 Medium. Advisory
CVE-2004-2636 Path Traversal (CWE-22) - Fixed in v1.93. CVSS 5.0 Medium. Advisory
CVE-2003-1510 Denial of Service (CWE-400) - Fixed in v1.93. CVSS 7.8 High. Advisory