Skip to main content

morgan CVE-2026-5078

| EUVDEUVD-2026-34067 MEDIUM
Improper Output Neutralization for Logs (CWE-117)
2026-06-03 openjs GHSA-4vj7-5mj6-jm8m
5.3
CVSS 3.1 · Vendor: openjs
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send HTTP request with CR/LF-embedded Basic Auth username
  2. Delivery
    Morgan extracts :remote-user token without sanitization
  3. Exploit
    Control characters break log line boundary
  4. Execution
    Injected lines written to log stream as legitimate entries
  5. Impact
    Forged audit trail conceals attacker activity or spoofs events

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A09:2025 - Security Logging & Alerting Failures
ASVS 5.0
V16 - Security Logging and Error Handling Log output neutralization
Exploitation Conditions

The application must be running morgan in version range 1.2.0-1.10.1 with a format that references the :remote-user token - this includes the built-in combined, common, default, and short formats, as well as any user-defined custom format string containing :remote-user. No authentication is required; any HTTP client that can reach the application's listening port can supply an arbitrary Authorization header. No special server-side configuration is needed beyond morgan being active with an affected format. Exploitation is limited by the following: the attacker must know or guess that the endpoint is morgan-instrumented (trivial to determine via response headers or open-source intelligence on Express.js stacks), the impact is strictly confined to log integrity with no path to code execution or data exfiltration, and applications already running morgan 1.11.0 or using a :remote-user-free format string are fully unaffected.

Impact

The CVSS 3.1 score of 5.3 (Medium) with vector AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N accurately captures that this is trivially reachable from the network with no authentication or user interaction, but produces only limited integrity impact - no confidentiality or availability loss. No EPSS score was provided in the input data, so exploitation probability cannot be quantified. The CVE is not listed in CISA KEV and no POC code is identified, placing this in a genuine medium-priority category rather than an emergency. The real-world risk is disproportionately higher for organizations that rely on morgan access logs as a security control: an attacker can use log forgery to mask their true request patterns, spoof benign-looking entries, or overwhelm log parsers. Because any unauthenticated HTTP request carrying a crafted Authorization header is sufficient for exploitation, automated scanning or opportunistic exploitation is feasible at low cost. However, the concrete impact is constrained to log integrity and does not lead to direct data access, code execution, or service disruption. Priority should be elevated for deployments where access logs feed SIEM alerting or compliance audit trails.

Exploit ScenarioDerived

An unauthenticated attacker sends an HTTP GET request to any endpoint of a morgan-instrumented Express.js application with an Authorization header of the form Basic <base64('legit 192.0.2.1 - admin [01/Jun/2026] "GET /admin HTTP/1.1" 200 512')>. When morgan logs the request, the embedded CR+LF causes a second, fully forged log line to appear in the access log, attributed to a spoofed IP and user. This forged line is indistinguishable from a real entry, allowing the attacker to manufacture a false audit trail or obscure their actual activity from log-based detection systems.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 03, 2026

Log injection in morgan Node.js middleware versions 1.2.0 through 1.10.1 allows unauthenticated remote attackers to forge access log entries by embedding CR or LF control characters in the Basic authentication username of the Authorization request header. The :remote-user format token writes this value to the log stream without sanitization, breaking the one-request-per-line log structure and enabling attackers to fabricate arbitrary log lines visible to downstream consumers such as SIEMs or log aggregators. No active exploitation is confirmed (not in CISA KEV) and no public exploit code is identified at time of analysis, but the zero-prerequisite network attack vector and widespread use of morgan across the Node.js/Express ecosystem make this a meaningful integrity risk for security monitoring pipelines.

RemediationAI

Upgrade morgan to version 1.11.0, the vendor-released patch that neutralizes control characters in :remote-user token output before writing to the log stream. This is documented in the OpenJS Foundation advisory at https://github.com/expressjs/morgan/security/advisories/GHSA-4vj7-5mj6-jm8m and the CNA page at https://cna.openjsf.org/security-advisories.html. If an immediate upgrade is not possible, switch to a custom morgan format string that omits the :remote-user token entirely - the trade-off is loss of authenticated username capture in access logs, which may reduce visibility for authentication auditing and forensics. An additional compensating control is to configure a reverse proxy or WAF to reject or strip Authorization headers containing raw CR or LF bytes before they reach the Node.js process; this blocks the injection vector at the perimeter but requires careful regex or byte-inspection rules to avoid breaking legitimate Basic auth flows. The upgrade path has no known side effects.

Affected VersionsENISA

morgan 1.2.0 ≤1.10.1

Affected Packages

npm morgan fix: 1.11.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

morgan is a widely deployed HTTP request logging middleware for Node.js, commonly used with Express.js. It supports configurable format strings composed of tokens - :remote-user being one that extracts the username component from a parsed Basic Authentication Authorization header. The root cause is CWE-117 (Improper Output Neutralization for Logs): user-controlled input is written to the log stream without stripping or escaping newline characters (CR \r, LF \n), which are structural delimiters in line-oriented log formats. This allows a single HTTP request to produce multiple log lines, with the injected lines appearing indistinguishable from legitimate access log entries. All four built-in morgan format strings - combined, common, default, and short - reference :remote-user and are therefore affected. Any user-defined custom format that includes :remote-user is equally vulnerable. The affected CPE is cpe:2.3:a:morgan:morgan:*:*:*:*:*:*:*:*, with the authoritative version range of 1.2.0-1.10.1 established by the OpenJS Foundation advisory.

Know when Morgan gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (openjs) PRIMARY 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
SUSE MEDIUM
Red Hat 5.3 MEDIUM

Primary rating from Vendor (openjs).

CVSS VectorVendor: openjs

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 241 npm packages depend on morgan (3 direct, 238 indirect)

Ecosystem-wide dependent count for version 1.2.0.

Threat Intelligence Overview

EPSS Score
0.0%
Top 91% exploitable
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
2
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Vendor StatusVendor

SUSE

Severity: Moderate

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy