CVE-2026-87859
Received Received - Intake

Double Quote Injection in Morgan HTTP Logger

Vulnerability report for CVE-2026-87859, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-09-11

Last updated on: 2026-09-11

Assigner: 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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-09-11
Last Modified
2026-09-11
Generated
2026-09-11
AI Q&A
2026-09-11
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
expressjs morgan to 1.12.1 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-117 The product constructs a log message from external input, but it does not neutralize or incorrectly neutralizes special elements when the message is written to a log file.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability affects the morgan HTTP request logger middleware for Node.js. In versions before 1.12.1, the escapeLogField() function fails to escape double quotes in quoted log fields. Attackers can exploit this by including a double quote in fields like User-Agent or Referer headers, causing log consumers to misread subsequent fields.

Detection Guidance

Check if your system uses morgan versions prior to 1.12.1 by running: npm list morgan. If vulnerable, logs may show unexpected field values due to unescaped double quotes in headers like User-Agent or Referer.

Impact Analysis

This vulnerability can lead to log injection attacks where attackers manipulate logged data. For example, they can forge values like response status or byte count in machine-parsed logs. This may cause incorrect monitoring, auditing, or security analysis based on falsified log entries.

Mitigation Strategies

Upgrade morgan to version 1.12.1 or later using: npm update morgan. Alternatively, switch to unquoted log formats like 'tiny' or 'dev' if upgrading isn't feasible.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-87859. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart