Skip to content
OpenAdvisories
Medium · 5.3 CVE-2026-87859 EUVD-2026-76027GHSA-9f6g-j8ch-79g4

morgan vulnerable to Log Injection via unescaped double quote in quoted log fields

Published Sep 11, 2026 · Updated Sep 11, 2026 · Assigned by openjs

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 products

VendorProductAffectedFixed
morgan morgan < 1.12.1 1.12.1

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 node-morgan 1.12.1+~1.9.10-1 —
Debian 13 node-morgan No fix yet —
Debian 12 node-morgan No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 node-morgan No fix yet —
Ubuntu 26.04 LTS node-morgan No fix yet —
Ubuntu 24.04 LTS node-morgan No fix yet —
Ubuntu 22.04 LTS node-morgan No fix yet —

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling json-server 0.17.4-r14 —
Wolfi rolling tileserver-gl 5.6.0-r17 —

Affected packages

EcosystemPackageAffectedFixedRecord
npm morgan < 1.12.1 1.12.1 GHSA-9f6g-j8ch-79g4

References