CVE-2026-5078: morgan vulnerable to Log Forging via unneutralized control characters in :remote-user
Impact Morgan's :remote-user token extracts the Basic auth username from the Authorization header and writes it to the log stream without neutralizing control characters. An attacker can send a crafted Authorization: Basic header containing CR/LF characters to inject forged log lines, corrupting the one-request-per-line structure of access logs.
Published Jul 10, 2026
Affected packages
morgan
- Ecosystem
- npm
- Affected
- >= 1.2.0, <= 1.10.1
- Fixed in
- 1.11.0
- Check
npm ls morgan
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
Morgan's :remote-user token extracts the Basic auth username from the Authorization header and writes it to the log stream without neutralizing control characters. An attacker can send a crafted Authorization: Basic header containing CR/LF characters to inject forged log lines, corrupting the one-request-per-line structure of access logs.
The built-in combined, common, default, and short formats are affected, as well as any custom format that includes :remote-user.
Patches
Users should upgrade to version 1.11.0.
Workarounds
Use a custom format string that does not include :remote-user.
Credited to yuki-matsuhashi, UlisesGascon, jonchurch.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
