Improper Output Neutralization for Logs Affecting morgan package, versions >=1.2.0 <1.11.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.25% (16th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Output Neutralization for Logs vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-MORGAN-17135841
  • published3 Jun 2026
  • disclosed3 Jun 2026
  • creditYuki Matsuhashi

Introduced: 3 Jun 2026

CVE-2026-5078  (opens in a new tab)
CWE-117  (opens in a new tab)

How to fix?

Upgrade morgan to version 1.11.0 or higher.

Overview

morgan is a HTTP request logger middleware for node.js.

Affected versions of this package are vulnerable to Improper Output Neutralization for Logs via the :remote-user token, which extracts the Basic auth username from the Authorization header and writes it to the log stream without neutralizing control characters. An attacker can inject forged log lines by sending crafted Authorization headers containing CR or LF bytes, potentially breaking the one-request-per-line structure of access logs and misleading downstream log consumers.

Workaround

This vulnerability can be mitigated by using a custom format string that does not include :remote-user.

CVSS Base Scores

version 4.0
version 3.1