morgan@1.6.1

HTTP request logger middleware for node.js

  • latest version

    1.12.1

  • latest non vulnerable version

  • first published

    12 years ago

  • latest version published

    3 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the morgan package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • M
    Improper Output Neutralization for Logs

    morgan is a HTTP request logger middleware for node.js.

    Affected versions of this package are vulnerable to Improper Output Neutralization for Logs via the escapeLogField function. An attacker can manipulate log entries by injecting unescaped double quotes into HTTP headers such as User-Agent or Referer, causing log consumers that parse logs by field position to misinterpret attacker-supplied data as subsequent fields.

    How to fix Improper Output Neutralization for Logs?

    Upgrade morgan to version 1.12.1 or higher.

    <1.12.1
    • M
    Improper Output Neutralization for Logs

    morgan is a HTTP request logger middleware for node.js.

    Affected versions of this package are vulnerable to Improper Output Neutralization for Logs in its format-token expansion, which does not neutralize the Unicode line separators U+0085 (NEL), U+2028 (LINE SEPARATOR), and U+2029 (PARAGRAPH SEPARATOR) in logged fields such as :url, :user-agent, :referrer, :req[header], and :remote-user, unlike the earlier fix that escaped C0 control characters. An attacker can forge additional log records by sending ordinary HTTP request headers or a request URL containing these characters, which Unicode-aware downstream log processors interpret as line breaks and split into separate entries. Exploitation requires the downstream log analysis tooling to treat these code points as record separators, and all built-in formats (combined, common, default, and short) are affected.

    Note: This is a bypass of the fix for the vulnerability described in CVE-2026-5078.

    How to fix Improper Output Neutralization for Logs?

    Upgrade morgan to version 1.12.0 or higher.

    <1.12.0
    • M
    Improper Output Neutralization for Logs

    morgan is a HTTP request logger middleware for node.js.

    Affected versions of this package are vulnerable to Improper Output Neutralization for Logs via the :remote-user token, which extracts the Basic auth username from the Authorization header and writes it to the log stream without neutralizing control characters. An attacker can inject forged log lines by sending crafted Authorization headers containing CR or LF bytes, potentially breaking the one-request-per-line structure of access logs and misleading downstream log consumers.

    How to fix Improper Output Neutralization for Logs?

    Upgrade morgan to version 1.11.0 or higher.

    >=1.2.0 <1.11.0
    • M
    Arbitrary Code Injection

    morgan is a HTTP request logger middleware for node.js.

    Affected versions of this package are vulnerable to Arbitrary Code Injection. An attacker could use the format parameter to inject arbitrary commands.

    How to fix Arbitrary Code Injection?

    Upgrade morgan to version 1.9.1 or higher.

    <1.9.1