GHSA-f57v-q966-7fh6: Monolog/monolog Monolog Header Injection Vulnerability

LOW
CWE-74
Published
Advisory Summary

GHSA-f57v-q966-7fh6 is a LOW monolog header injection vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Monolog/monolog libraries in the Packagist ecosystem. The issue involves monolog header injection in nativemailerhandler. Remediation is available by upgrading affected packages to version 1.12.0.

GHSA-f57v-q966-7fh6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f57v-q966-7fh6
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Monolog/monolog
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-f57v-q966-7fh6

To remediate this vulnerability, upgrade all affected Monolog/monolog dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

monolog/monolog fixed: 1.12.0
Upgrade monolog/monolog to 1.12.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for monolog/monolog

How to Check if You Are Affected

To determine whether your application is affected by GHSA-f57v-q966-7fh6, inspect your project dependencies for Monolog/monolog:

inspect dependencies for monolog/monolog

Analyze the terminal output to locate any version of Monolog/monolog in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.12.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Monolog/monolog, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A header injection vulnerability has been identified in the NativeMailerHandler of the Monolog library. This vulnerability may allow an attacker to manipulate email headers when log messages are sent via email.

GHSA-f57v-q966-7fh6 Affected Monolog/monolog Versions

1 component(s)
Fixed Versions:
1.12.0
Product / Package Ecosystem Affected Versions Fixed Version
monolog/monolog
Packagist
≥ 1.8.0
< 1.12.0
1.12.0

References

Frequently Asked Questions

What is GHSA-f57v-q966-7fh6?
GHSA-f57v-q966-7fh6 is a security vulnerability in Monolog/monolog involving Monolog Header injection in NativeMailerHandler under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Monolog/monolog versions are affected?
Affected versions include releases prior to 1.12.0 across affected packages: monolog/monolog.
What version fixes GHSA-f57v-q966-7fh6?
Upgrading to 1.12.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is monolog/monolog affected?
Yes, monolog/monolog is affected in releases prior to 1.12.0. Upgrade your dependency to 1.12.0 or later.
What CWE is associated with GHSA-f57v-q966-7fh6?
GHSA-f57v-q966-7fh6 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check Packagist dependencies for GHSA-f57v-q966-7fh6?
Run the dependency tree command: 'inspect dependencies for monolog/monolog'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f57v-q966-7fh6",
  "modified" : "2024-05-15T23:08:13Z",
  "published" : "2024-05-15T23:08:13Z",
  "aliases" : [ ],
  "summary" : "Monolog Header injection in NativeMailerHandler",
  "details" : "A header injection vulnerability has been identified in the NativeMailerHandler of the Monolog library. This vulnerability may allow an attacker to manipulate email headers when log messages are sent via email.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "monolog/monolog"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.8.0"
      }, {
        "fixed" : "1.12.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Seldaek/monolog/issues/458"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Seldaek/monolog/pull/448#issuecomment-68208704"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Seldaek/monolog/commit/515a096c864b00b3967f7f601680f85d4a2e4001"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/monolog/monolog/2014-12-29-1.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Seldaek/monolog"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T23:08:13Z",
    "nvd_published_at" : null
  }
}