{"id":"CVE-2026-5078","aliases":["CVE-2026-5078","GHSA-4vj7-5mj6-jm8m"],"related":[],"kind":"vulnerability","state":"published","title":"morgan vulnerable to Log Forging via unneutralized control characters in :remote-user","summary":"Impact: The morgan logging middleware's :remote-user token extracts the Basic auth username from the Authorization request header and writes it to the log stream without neutralizing control characters. An unauthenticated attacker can send a crafted Authorization Basic header containing CR or LF bytes to inject forged log lines, breaking the one-request-per-line structure of access logs and enabling log forgery against downstream log consumers. The built-in combined, common, default, and short formats are affected, as well as any custom format that references :remote-user. Affected versions: morgan 1.2.0 through 1.10.1. Patches: upgrade to morgan 1.11.0, which neutralizes control characters in the :remote-user token output. Workarounds: use a custom format string that does not include :remote-user.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Impact: The morgan logging middleware's :remote-user token extracts the Basic auth username from the Authorization request header and writes it to the log stream without neutralizing control characters. An unauthenticated attacker can send a crafted Authorization Basic header containing CR or LF bytes to inject forged log lines, breaking the one-request-per-line structure of access logs and enabling log forgery against downstream log consumers. The built-in combined, common, default, and short formats are affected, as well as any custom format that references :remote-user. Affected versions: morgan 1.2.0 through 1.10.1. Patches: upgrade to morgan 1.11.0, which neutralizes control characters in the :remote-user token output. Workarounds: use a custom format string that does not include :remote-user.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nMorgan's `:remote-user` token extracts the Basic auth username from the `Authorization` header and writes it to the log stream without neutralizing control characters. An attacker can send a crafted `Authorization: Basic` header containing CR/LF characters to inject forged log lines, corrupting the one-request-per-line structure of access logs.\n\nThe built-in `combined`, `common`, `default`, and `short` formats are affected, as well as any custom format that includes `:remote-user`.\n\n### Patches\n\nUsers should upgrade to version 1.11.0.\n\n### Workarounds\n\nUse a custom format string that does not include `:remote-user`.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Impacto: El token :remote-user del middleware de registro morgan extrae el nombre de usuario de autenticación Basic del encabezado de solicitud de autorización y lo escribe en el flujo de registro sin neutralizar los caracteres de control. Un atacante no autenticado puede enviar un encabezado Authorization Basic manipulado que contiene bytes CR o LF para inyectar líneas de registro falsificadas, rompiendo la estructura de una solicitud por línea de los registros de acceso y permitiendo la falsificación de registros contra los consumidores de registros posteriores. Los formatos integrados combined, common, default y short se ven afectados, así como cualquier formato personalizado que haga referencia a :remote-user. Versiones afectadas: morgan 1.2.0 hasta 1.10.1. Parches: actualizar a morgan 1.11.0, que neutraliza los caracteres de control en la salida del token :remote-user. Soluciones alternativas: usar una cadena de formato personalizada que no incluya :remote-user.","source":"nvd"}],"published":"2026-06-03T05:56:49.512Z","modified":"2026-09-10T03:51:10.338Z","severity":{"scorer":"openjs","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"openjs","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-117"],"affected":[{"ranges":[{"type":"semver","introduced":"1.2.0","lastAffected":"1.10.1","status":"affected"},{"type":"semver","version":"1.11.0","status":"unaffected"}],"vendor":"morgan","product":"morgan","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.2.0","status":"affected","fixed":"1.11.0"}],"ecosystem":"npm","package":"morgan","purl":"pkg:npm/morgan","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.2.0","fixed":"1.11.0"}],"vendor":"morgan_project","product":"morgan","cpe":"cpe:2.3:a:morgan_project:morgan:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/expressjs/morgan/security/advisories/GHSA-4vj7-5mj6-jm8m","tags":["mitigation","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://cna.openjsf.org/security-advisories.html","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-5078","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/expressjs/morgan","tags":["package"],"sources":["ghsa"]}],"credits":["Yuki Matsuhashi","Ulises Gascón","Jon Church"],"assigner":"openjs","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-06-03T13:16:59.663Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-5078","url":"https://www.cve.org/CVERecord?id=CVE-2026-5078","licence":"CVE Terms of Use","modified":"2026-06-03T13:19:32.922Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4vj7-5mj6-jm8m","url":"https://github.com/advisories/GHSA-4vj7-5mj6-jm8m","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:10.338Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-5078","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-5078","licence":"Public domain","modified":"2026-07-22T19:10:00.120Z"}],"updatedAt":"2026-11-25T22:59:23.625Z","epss":{"score":0.00415,"percentile":0.27434,"date":"2026-11-30T12:00:22.000Z"}}