Vulnerability · Published Sep 11, 2026 · Assigned by openjs

CVE-2026-87859morgan vulnerable to Log Injection via unescaped double quote in quoted log fields

Medium 5.3

In plain English

A medium-severity security flaw in morgan from morgan. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 35% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.3Medium
Exploit odds (30 days)0.4%top 64.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

morgan is an HTTP request logger middleware for Node.js. In versions before 1.12.1, its escapeLogField() function does not escape the double quote character, which delimits the quoted fields of the Apache combined log format that morgan emits. An unauthenticated remote attacker who controls a value written to a quoted field, such as the User-Agent or Referer header, can include a double quote to close that field early, so a log consumer that parses the log by field position reads attacker-supplied text as the following field. In the built-in formats this makes the recorded value differ from the value that was sent, and in custom formats that quote an attacker-controlled token before a server-controlled one it can forge values such as the response status. No newline is injected, so record separation stays intact. The issue is fixed in morgan 1.12.1, which escapes the double quote. Users should upgrade to morgan 1.12.1 or later.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12node-morganno fix listedDEBIAN-CVE-2026-87859
Debian:13node-morganno fix listedDEBIAN-CVE-2026-87859
Debian:14node-morgan1.12.1+~1.9.10-1DEBIAN-CVE-2026-87859
Ubuntu:22.04:LTSnode-morganno fix listedUBUNTU-CVE-2026-87859
Ubuntu:24.04:LTSnode-morganno fix listedUBUNTU-CVE-2026-87859
Ubuntu:26.04:LTSnode-morganno fix listedUBUNTU-CVE-2026-87859
Ubuntu:26.10node-morganno fix listedUBUNTU-CVE-2026-87859
npmmorgan1.12.1GHSA-9f6g-j8ch-79g4

Affected products (as reported)

VendorProductVersions
morgan morgan 0 – before 1.12.1

Weakness: CWE-117 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

References