Vulnerabilities in pkg:npm/morgan
PACKAGECVE-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.
pkg:npm/morgan
Vulnerability advisories affecting package pkg:npm/morgan. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-9f6g-j8ch-79g4 | CVE-2026-87859 | MODERATE | morgan vulnerable to Log Injection via unescaped double quote in quoted log fields |
| GHSA-jxfw-x594-9x9m | CVE-2026-15603 | MODERATE | morgan vulnerable to Log Forging via unescaped Unicode line separators |
| GHSA-4vj7-5mj6-jm8m | CVE-2026-5078 | MODERATE | morgan vulnerable to Log Forging via unneutralized control characters in :remote-user |
| GHSA-gwg9-rgvj-4h5j | CVE-2019-5413 | CRITICAL | Code Injection in morgan |
CVE-2026-87859 at a Glance
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).
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.
npm install morgan@1.12.1
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
CVE-2026-87859 Affected Morgan Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
morgan
|
npm |
< 1.12.1
|
1.12.1
|
References
Frequently Asked Questions
What is CVE-2026-87859?
Which Morgan versions are affected?
What version fixes CVE-2026-87859?
Is morgan affected?
What is the CVSS score of CVE-2026-87859?
What CWE is associated with CVE-2026-87859?
How can I check npm dependencies for CVE-2026-87859?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}