GitHub Advisoryadvisory · npm
GHSA-4vj7-5mj6-jm8m morgan vulnerable to Log Forging via unneutralized control characters in :remote-user
MEDIUM
Official page ↗
- Aliases
- CVE-2026-5078
- Ecosystem
- npm
- Packages
- morgan
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
- Weaknesses
- CWE-117
- Reviewed
- 2026-07-10
Affected packages
• npm morgan: >= 1.2.0, < 1.11.0 → fixed in 1.11.0
Description
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`.
Related
Alias · CVE (1)
- CVE-2026-5078 Impact: The morgan logging middleware's :remote-user token extracts the Basic auth username from the Authorization request header and… vulnerability
Weakness · CWE (1)
- CWE-117 Improper Output Neutralization for Logs weakness