p PatchFirst

CVE-2026-87859

CVE-2026-87859 · morgan vulnerable to Log Injection via unescaped double quote in quoted log fields

This page contains facts from public vulnerability sources. Check the original advisory before updating.

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 5.3 · Medium · EPSS 0.4% · Fix available

Published
Updated

Stack: system · node

Affected products and versions

  • morgan

    Versions
    • ≥ 0, < 1.12.1: Affected (semver)
    • 1.12.1: Not affected (semver)

    Update to 1.12.1

  • node-morgan Debian:12

    Versions
    • 1.10.0+~1.9.3-1
    • 1.10.1+~1.9.10-1
    • 1.12.0+~1.9.10-1
    • 1.12.1+~1.9.10-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-morgan Debian:13

    Versions
    • 1.10.0+~1.9.3-1
    • 1.10.1+~1.9.10-1
    • 1.12.0+~1.9.10-1
    • 1.12.1+~1.9.10-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-morgan Debian:14

    Versions
    • 1.10.0+~1.9.3-1
    • 1.10.1+~1.9.10-1
    • 1.12.0+~1.9.10-1
    Affected ranges
    • ECOSYSTEM: < 1.12.1+~1.9.10-1

    Update to 1.12.1+~1.9.10-1

  • morgan npm

    Affected ranges
    • SEMVER: < 1.12.1

    Update to 1.12.1

  • node-morgan Ubuntu:22.04:LTS

    Versions
    • 1.10.0-2
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-morgan Ubuntu:24.04:LTS

    Versions
    • 1.10.0+~1.9.3-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-morgan Ubuntu:26.10

    Versions
    • 1.10.1+~1.9.10-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-morgan Ubuntu:26.04:LTS

    Versions
    • 1.10.0+~1.9.3-1
    • 1.10.1+~1.9.10-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

Original sources

Check your server →