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.
Published: 2026-06-03
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

morgan is a Node.js logging middleware that records HTTP request details. The :remote-user token extracts the username from the Basic Authorization header and writes it to the log stream without neutralizing control characters. An attacker who can send a request with a crafted Authorization header containing CR or LF bytes can inject arbitrary log lines, breaking the one‑request‑per‑line convention and enabling forged entries for downstream log consumers. This flaw, classified as CWE‑117, allows log forgery that could be used to obscure real traffic or mislead monitoring tools, though it does not grant direct code execution or privilege escalation.

Affected Systems

Affected versions are morgan 1.2.0 through 1.10.1. Any Node.js application that relies on the built‑in combined, common, default, or short log formats, or any custom format that references :remote-user, is vulnerable. The issue exists regardless of the underlying server framework, because it is tied to the morgan middleware itself.

Risk and Exploitability

The vulnerability can be exploited remotely by sending a specially crafted HTTP request over the network; the attacker does not need authentication or elevated privileges. The CVSS base score of 5.3 indicates moderate risk, and there is no EPSS score available, suggesting limited current exploitation data. The flaw is not listed as a Known Exploited Vulnerability, but the ability to inject arbitrary log entries demonstrates that an unauthenticated attacker could tamper with log integrity for any exposed web application that uses the vulnerable version of morgan.

Generated by OpenCVE AI on June 3, 2026 at 12:23 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the morgan package to version 1.11.0 or later, which neutralizes control characters in the :remote-user token.
  • Reconfigure the application’s logging format to exclude the :remote-user token if an upgrade is not immediately feasible.
  • Implement input validation that strips CR and LF characters from the Authorization header before it reaches the logging middleware, or remove the header when it is not required for request processing.

Generated by OpenCVE AI on June 3, 2026 at 12:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 03 Jun 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 03 Jun 2026 11:15:00 +0000

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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: openjs

Published:

Updated: 2026-06-03T13:19:32.922Z

Reserved: 2026-03-28T17:42:51.328Z

Link: CVE-2026-5078

cve-icon Vulnrichment

Updated: 2026-06-03T13:19:27.190Z

cve-icon NVD

Status : Received

Published: 2026-06-03T08:16:19.743

Modified: 2026-06-03T08:16:19.743

Link: CVE-2026-5078

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-03T12:30:26Z

Weaknesses