CVE-2026-87859: Morgan Morgan Vulnerable To Log Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-9f6g-j8ch-79g4
CVSS 5.3
CWE-117
Published
Advisory Summary

CVE-2026-87859 is a MODERATE (CVSS 5.3) morgan vulnerable to log injection vulnerability (CWE-117: Improper Output Neutralization for Logs) affecting Morgan libraries in the npm ecosystem. The issue involves morgan vulnerable to log injection via unescaped double quote in quoted log fields. Remediation is available by upgrading affected packages to version 1.12.1.

CVE-2026-87859 at a Glance

CVE Identifier CVE-2026-87859
GHSA Identifier GHSA-9f6g-j8ch-79g4
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-117: Improper Output Neutralization for Logs
Affected Product Morgan
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-87859

To remediate this vulnerability, upgrade all affected Morgan dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

morgan fixed: 1.12.1
npm install morgan@1.12.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls morgan

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-87859, inspect your project dependencies using npm:

npm ls morgan

Analyze the terminal output to locate any version of Morgan in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.12.1), your application is affected.

Note: The npm ls morgan command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-117: Improper Output Neutralization for Logs, where 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. In Morgan, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Morgan writes attacker-controlled request data to the access log. Its escaping (added in 1.11.0 and 1.12.0) neutralizes control characters, the Unicode line separators, and backslash, but not the double quote (`0x22`), which is the field delimiter of the Apache combined log format morgan emits. An attacker who controls a quoted field (`:user-agent`, `:referrer`, the request URL, or the Basic auth `:remote-user`) can inject a double quote to close the field early and forge additional fields in the log record. The `combined`, `common`, and `default` formats, and any custom format that quotes a token, are affected. This is an incomplete fix of CVE-2026-5078 and CVE-2026-15603. ### Patches Users should upgrade to version 1.12.1. ### Workarounds Update to version 1.12.1.

CVE-2026-87859 Affected Morgan Versions

1 component(s)
Fixed Versions:
1.12.1
Product / Package Ecosystem Affected Versions Fixed Version
morgan
npm
< 1.12.1
1.12.1

References

Frequently Asked Questions

What is CVE-2026-87859?
CVE-2026-87859 is a security vulnerability in Morgan involving morgan vulnerable to Log Injection via unescaped double quote in quoted log fields under CWE-117: Improper Output Neutralization for Logs.
Which Morgan versions are affected?
Affected versions include releases prior to 1.12.1 across affected packages: morgan.
What version fixes CVE-2026-87859?
Upgrading to 1.12.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is morgan affected?
Yes, morgan is affected in releases prior to 1.12.1. Upgrade your dependency to 1.12.1 or later.
What is the CVSS score of CVE-2026-87859?
CVE-2026-87859 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-87859?
CVE-2026-87859 is classified under CWE-117: Improper Output Neutralization for Logs (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.).
How can I check npm dependencies for CVE-2026-87859?
Run the dependency tree command: 'npm ls morgan'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9f6g-j8ch-79g4",
  "modified" : "2026-09-28T21:33:08Z",
  "published" : "2026-09-28T21:33:08Z",
  "aliases" : [ "CVE-2026-87859" ],
  "summary" : "morgan vulnerable to Log Injection via unescaped double quote in quoted log fields",
  "details" : "### Impact\n\nMorgan writes attacker-controlled request data to the access log. Its escaping (added in 1.11.0 and 1.12.0) neutralizes control characters, the Unicode line separators, and backslash, but not the double quote (`0x22`), which is the field delimiter of the Apache combined log format morgan emits. An attacker who controls a quoted field (`:user-agent`, `:referrer`, the request URL, or the Basic auth `:remote-user`) can inject a double quote to close the field early and forge additional fields in the log record. The `combined`, `common`, and `default` formats, and any custom format that quotes a token, are affected. This is an incomplete fix of CVE-2026-5078 and CVE-2026-15603.\n\n### Patches\n\nUsers should upgrade to version 1.12.1.\n\n### Workarounds\n\nUpdate to version 1.12.1.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "morgan"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.12.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/expressjs/morgan/security/advisories/GHSA-9f6g-j8ch-79g4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-87859"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/expressjs/morgan/commit/4b695edf967ce179cdf4009fe8cddd184b7511ee"
  }, {
    "type" : "WEB",
    "url" : "https://cna.openjsf.org/security-advisories.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/expressjs/morgan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/expressjs/morgan/releases/tag/1.12.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-117" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-28T21:33:08Z",
    "nvd_published_at" : "2026-09-11T10:16:53Z"
  }
}