morgan vulnerable to Log Injection via unescaped double quote in quoted log fields (morgan morgan)
At a glance
- Source
- NVD
- EPSS
- EPSS 0.41 % · percentile 35 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- openjs
- NVD status
- Awaiting Analysis
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.
Weaknesses (CWE)
- CWE-117 — Improper Output Neutralization for Logs
References
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N | openjs |
| CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N | NVD · ce714d77-add3-4f53-aff5-83d477b104bb (Secondary) |
Advisories
- GHSA-9f6g-j8ch-79g4 — morgan vulnerable to Log Injection via unescaped double quote in quoted log fields
European references
- ENISA EUVD · EUVD-2026-76027
- GCVE · GCVE-0-2026-87859
CERT-FR advisories
- CERTFR-2026-AVI-1378 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
Affected products
| Product | Versions |
|---|---|
| morgan · morgan | affected 0 < 1.12.1 ; unaffected 1.12.1 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| CERT-FR (ANSSI) | Licence Ouverte / Etalab 2.0 |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |