CVE-2026-87859
morgan is an HTTP request logger middleware for Node.js. In …
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.
What to do now
- Check your exposureFind out whether the affected software runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Limit access until thenIf you cannot update at once, take the system off the internet or restrict who can reach it.
References
- cna.openjsf.org/security-advisories.html
- github.com/expressjs/morgan/security/advisories/GHSA-9f6g-j8ch-79g4
- nvd.nist.gov/vuln/detail/CVE-2026-87859
- github.com/expressjs/morgan/commit/4b695edf967ce179cdf4009fe8cddd184b7511ee
- github.com/expressjs/morgan/releases/tag/1.12.1
- github.com/advisories/GHSA-9f6g-j8ch-79g4
- nvd.nist.gov/vuln/detail/CVE-2026-87859
- cve.org/CVERecord?id=CVE-2026-87859
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.