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

Published Jun 3, 2026
·
Updated

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.

Other sources

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.

MITRE

Affected Software

3 affected componentsFixes available
npm/morgan>=1.2.0<=1.10.1
Morgan Project Morgan Node.js>=1.2.0<1.11.0
npm/morgan>=1.2.0<=1.10.1
1.11.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/morgan to a version that resolves this vulnerability.

    Fixed in 1.11.0
  2. Upgrade

    Upgrade morgan to a version that resolves this vulnerability.

    Fixed in 1.11.0
  3. Configuration

    Update the Morgan log format used for access logs (built-in combined/common/default/short or any custom format) to remove the :remote-user token, or replace it with fields that do not include :remote-user.

    morgan logging middleware log format (avoid :remote-user) = custom format string without :remote-user

Event History

Jun 3, 2026
CVE Published
via MITRE·05:56 AM
Data Sourced
via MITRE·05:56 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:16 AM
DescriptionSeverityWeaknessAffected Software
Jul 10, 2026
Advisory Published
via GitHub·02:32 PM
Data Sourced
via GitHub·02:32 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-5078?

The severity of CVE-2026-5078 is medium with a score of 5.3.

2

How do I fix CVE-2026-5078?

To fix CVE-2026-5078, update the morgan logging middleware to the latest version where the vulnerability has been addressed.

3

What impact does CVE-2026-5078 have on my application?

CVE-2026-5078 allows an unauthenticated attacker to perform log forging by exploiting unneutralized control characters in the :remote-user token.

4

Can CVE-2026-5078 be exploited remotely?

Yes, CVE-2026-5078 can be exploited by unauthenticated attackers remotely through crafted Authorization Basic headers.

5

Is there a workaround for CVE-2026-5078 before applying a fix?

A potential workaround for CVE-2026-5078 is to validate and neutralize control characters in the header before logging.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203