CVE-2017-20187: Floriangaerber/magnesium Magnesium-PHP Injection Vulnerability Vulnerability

LOW
Advisory Identifier: GHSA-8pp6-5qpw-85g3
CVSS 3.5
CWE-74
Published
Advisory Summary

CVE-2017-20187 is a LOW (CVSS 3.5) magnesium-php injection vulnerability vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Floriangaerber/magnesium libraries in the Packagist ecosystem. The issue involves magnesium-php injection vulnerability. Remediation is available by upgrading affected packages to version 0.3.1.

CVE-2017-20187 at a Glance

CVE Identifier CVE-2017-20187
GHSA Identifier GHSA-8pp6-5qpw-85g3
Severity LOW
CVSS v3.1 Base Score 3.5
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Floriangaerber/magnesium
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 3.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Adjacent (AV:A)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2017-20187

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

floriangaerber/magnesium fixed: 0.3.1
Upgrade floriangaerber/magnesium to 0.3.1
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 floriangaerber/magnesium

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-20187, inspect your project dependencies for Floriangaerber/magnesium:

inspect dependencies for floriangaerber/magnesium

Analyze the terminal output to locate any version of Floriangaerber/magnesium in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.1), 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 Floriangaerber/magnesium, 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

** UNSUPPORTED WHEN ASSIGNED ** ** UNSUPPORTED WHEN ASSIGNED ** A vulnerability was found in Magnesium-PHP up to 0.3.0. It has been classified as problematic. Affected is the function formatEmailString of the file `src/Magnesium/Message/Base.php`. The manipulation of the argument email/name leads to injection. Upgrading to version 0.3.1 is able to address this issue. The patch is identified as 500d340e1f6421007413cc08a8383475221c2604. It is recommended to upgrade the affected component. VDB-244482 is the identifier assigned to this vulnerability. NOTE: This vulnerability only affects products that are no longer supported by the maintainer.

CVE-2017-20187 Affected Floriangaerber/magnesium Versions

1 component(s)
Fixed Versions:
0.3.1
Product / Package Ecosystem Affected Versions Fixed Version
floriangaerber/magnesium
Packagist
< 0.3.1
0.3.1

References

Frequently Asked Questions

What is CVE-2017-20187?
CVE-2017-20187 is a security vulnerability in Floriangaerber/magnesium involving Magnesium-PHP Injection vulnerability under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Floriangaerber/magnesium versions are affected?
Affected versions include releases prior to 0.3.1 across affected packages: floriangaerber/magnesium.
What version fixes CVE-2017-20187?
Upgrading to 0.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is floriangaerber/magnesium affected?
Yes, floriangaerber/magnesium is affected in releases prior to 0.3.1. Upgrade your dependency to 0.3.1 or later.
What is the CVSS score of CVE-2017-20187?
CVE-2017-20187 has a CVSS v3.1 base score of 3.5 (LOW) with vector string CVSS:3.0/AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2017-20187?
CVE-2017-20187 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 CVE-2017-20187?
Run the dependency tree command: 'inspect dependencies for floriangaerber/magnesium'. 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-8pp6-5qpw-85g3",
  "modified" : "2023-11-14T21:07:32Z",
  "published" : "2023-11-05T21:30:22Z",
  "aliases" : [ "CVE-2017-20187" ],
  "summary" : "Magnesium-PHP Injection vulnerability",
  "details" : "** UNSUPPORTED WHEN ASSIGNED ** ** UNSUPPORTED WHEN ASSIGNED ** A vulnerability was found in Magnesium-PHP up to 0.3.0. It has been classified as problematic. Affected is the function formatEmailString of the file `src/Magnesium/Message/Base.php`. The manipulation of the argument email/name leads to injection. Upgrading to version 0.3.1 is able to address this issue. The patch is identified as 500d340e1f6421007413cc08a8383475221c2604. It is recommended to upgrade the affected component. VDB-244482 is the identifier assigned to this vulnerability. NOTE: This vulnerability only affects products that are no longer supported by the maintainer.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "floriangaerber/magnesium"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-20187"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/floriangaerber/Magnesium-PHP/commit/500d340e1f6421007413cc08a8383475221c2604"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/floriangaerber/Magnesium-PHP"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/floriangaerber/Magnesium-PHP/releases/tag/v0.3.1"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.244482"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.244482"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-08T14:39:57Z",
    "nvd_published_at" : "2023-11-05T21:15:09Z"
  }
}