CVE-2019-1000005: Mpdf/mpdf MPDF Unsafe Deserialization Vulnerability

HIGH
Advisory Identifier: GHSA-3cwc-m7c2-qr86
CVSS 8.8
CWE-502
Published
Advisory Summary

CVE-2019-1000005 is a HIGH (CVSS 8.8) mpdf unsafe deserialization vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Mpdf/mpdf libraries in the Packagist ecosystem. The issue involves mpdf unsafe deserialization. Remediation is available by upgrading affected packages to version 7.1.8.

CVE-2019-1000005 at a Glance

CVE Identifier CVE-2019-1000005
GHSA Identifier GHSA-3cwc-m7c2-qr86
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Mpdf/mpdf
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.8

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

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

How to Fix CVE-2019-1000005

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

mpdf/mpdf fixed: 7.1.8
Upgrade mpdf/mpdf to 7.1.8
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 mpdf/mpdf

How to Check if You Are Affected

To determine whether your application is affected by CVE-2019-1000005, inspect your project dependencies for Mpdf/mpdf:

inspect dependencies for mpdf/mpdf

Analyze the terminal output to locate any version of Mpdf/mpdf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.1.8), 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Mpdf/mpdf, 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

mPDF version 7.1.7 and earlier contains a CWE-502: Deserialization of Untrusted Data vulnerability in getImage() method of Image/ImageProcessor class that can result in Arbitry code execution, file write, etc.. This attack appears to be exploitable via attacker must host crafted image on victim server and trigger generation of pdf file with content `<img src="phar://path/to/crafted/image">`. This vulnerability appears to have been fixed in 7.1.8.

CVE-2019-1000005 Affected Mpdf/mpdf Versions

1 component(s)
Fixed Versions:
7.1.8
Product / Package Ecosystem Affected Versions Fixed Version
mpdf/mpdf
Packagist
< 7.1.8
7.1.8

References

Frequently Asked Questions

What is CVE-2019-1000005?
CVE-2019-1000005 is a security vulnerability in Mpdf/mpdf involving mPDF Unsafe Deserialization under CWE-502: Deserialization of Untrusted Data.
Which Mpdf/mpdf versions are affected?
Affected versions include releases prior to 7.1.8 across affected packages: mpdf/mpdf.
What version fixes CVE-2019-1000005?
Upgrading to 7.1.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mpdf/mpdf affected?
Yes, mpdf/mpdf is affected in releases prior to 7.1.8. Upgrade your dependency to 7.1.8 or later.
What is the CVSS score of CVE-2019-1000005?
CVE-2019-1000005 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2019-1000005?
CVE-2019-1000005 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Packagist dependencies for CVE-2019-1000005?
Run the dependency tree command: 'inspect dependencies for mpdf/mpdf'. 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-3cwc-m7c2-qr86",
  "modified" : "2023-09-28T20:39:16Z",
  "published" : "2022-05-14T01:33:54Z",
  "aliases" : [ "CVE-2019-1000005" ],
  "summary" : "mPDF Unsafe Deserialization",
  "details" : "mPDF version 7.1.7 and earlier contains a CWE-502: Deserialization of Untrusted Data vulnerability in getImage() method of Image/ImageProcessor class that can result in Arbitry code execution, file write, etc.. This attack appears to be exploitable via attacker must host crafted image on victim server and trigger generation of pdf file with content `<img src=\"phar://path/to/crafted/image\">`. This vulnerability appears to have been fixed in 7.1.8.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "mpdf/mpdf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.1.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.1.7"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-1000005"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mpdf/mpdf/issues/949"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mpdf/mpdf"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-19T21:15:29Z",
    "nvd_published_at" : "2019-02-04T21:29:00Z"
  }
}