CVE-2026-5078

morgan vulnerable to Log Forging via unneutralized control characters in :remote-user

Published Jun 3, 2026 CVSS 3.1 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
Impact: The morgan logging middleware's :remote-user token extracts the Basic auth username from the Authorization request header and writes it to the log stream without neutralizing control characters. An unauthenticated attacker can send a crafted Authorization Basic header containing CR or LF bytes to inject forged log lines, breaking the one-request-per-line structure of access logs and enabling log forgery against downstream log consumers. The built-in combined, common, default, and short formats are affected, as well as any custom format that references :remote-user. Affected versions: morgan 1.2.0 through 1.10.1. Patches: upgrade to morgan 1.11.0, which neutralizes control characters in the :remote-user token output. Workarounds: use a custom format string that does not include :remote-user.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-4vj7-5mj6-jm8m morgan vulnerable to Log Forging via unneutralized control characters in :remote-user
History
Type Values Removed Values Added
First Time appeared Morgan
Morgan morgan
Vendors & Products Morgan
Morgan morgan
Type Values Removed Values Added
First Time appeared Morgan Project
Morgan Project morgan
CPEs cpe:2.3:a:morgan_project:morgan:*:*:*:*:*:node.js:*:*
Vendors & Products Morgan Project
Morgan Project morgan
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Impact: The morgan logging middleware's :remote-user token extracts the Basic auth username from the Authorization request header and writes it to the log stream without neutralizing control characters. An unauthenticated attacker can send a crafted Authorization Basic header containing CR or LF bytes to inject forged log lines, breaking the one-request-per-line structure of access logs and enabling log forgery against downstream log consumers. The built-in combined, common, default, and short formats are affected, as well as any custom format that references :remote-user. Affected versions: morgan 1.2.0 through 1.10.1. Patches: upgrade to morgan 1.11.0, which neutralizes control characters in the :remote-user token output. Workarounds: use a custom format string that does not include :remote-user.
Title morgan vulnerable to Log Forging via unneutralized control characters in :remote-user
Weaknesses CWE-117
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
openjs
Published
Updated
Jun 3, 2026, 1:19 PM
Reserved
Mar 28, 2026, 5:42 PM
Status
Analyzed
Published
Jun 3, 2026, 8:16 AM
Modified
Jul 22, 2026, 7:10 PM
Severity
Moderate
Public date
Jun 3, 2026, 5:56 AM