Skip to content
Heist/ feed
Back to feed
Critical

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-3838

DomPDF before version 2.0.0 is vulnerable to PHAR deserialization due to a lack of checking on the protocol before passing it into the file_get_contents() function. An attacker who can upload files of any type to the server can pass in the phar:// protocol to unserialize the uploaded file and instantiate arbitrary PHP objects. This can lead to remote code execution, especially when DOMPdf is used with frameworks with documented POP chains like Laravel or vulnerable developer code.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-3838
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:51 UTC · Revision 1

Source evidence

CVE-2021-3838

core-osv · Original source

Published 15 Nov 2024, 11:15 UTC

DomPDF before version 2.0.0 is vulnerable to PHAR deserialization due to a lack of checking on the protocol before passing it into the file_get_contents() function. An attacker who can upload files of any type to the server can pass in the phar:// protocol to unserialize the uploaded file and instantiate arbitrary PHP objects. This can lead to remote code execution, especially when DOMPdf is used with frameworks with documented POP chains like Laravel or vulnerable developer code.

osv:CVE-2021-3838
Complete source record
{
  "id": "aebe07696a9e88459fe1bb2c5b46dae2e4a4ab04832ab8a9d7275823cc28b7ce",
  "url": "https://osv.dev/vulnerability/CVE-2021-3838",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-3838",
    "summary": "DomPDF before version 2.0.0 is vulnerable to PHAR deserialization due to a lack of checking on the protocol before passing it into the file_get_contents() function. An attacker who can upload files of any type to the server can pass in the phar:// protocol to unserialize the uploaded file and instantiate arbitrary PHP objects. This can lead to remote code execution, especially when DOMPdf is used with frameworks with documented POP chains like Laravel or vulnerable developer code.",
    "evidence": "osv:CVE-2021-3838",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2021-3838",
      "aliases": [
        "CVE-2021-3838",
        "GHSA-577p-7j7h-2jgf"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/dompdf/dompdf",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "79573d8b8a141ec8a17312515de8740eed014fa9"
                },
                {
                  "fixed": "99aeec1efec9213e87098d42eb09439e7ee0bb6a"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:dompdf_project:dompdf:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.0.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "99aeec1efec9213e87098d42eb09439e7ee0bb6a"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.2.2",
            "v1.2.1",
            "v1.2.0",
            "v1.1.1",
            "v1.1.0",
            "v1.0.2",
            "v1.0.1",
            "v1.0.0",
            "v0.8.6",
            "v0.8.5",
            "v0.8.4",
            "v0.8.3",
            "v0.8.2",
            "v0.8.1",
            "v0.8.0",
            "v0.7.0",
            "v0.7.0-beta3",
            "v0.6.2",
            "v0.6.1",
            "v0.6.0",
            "v0.6.0-b3"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-3838.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:51.826375714Z",
      "provider": "osv",
      "references": [
        "https://github.com/dompdf/dompdf/commit/99aeec1efec9213e87098d42eb09439e7ee0bb6a",
        "https://huntr.com/bounties/0bdddc12-ff67-4815-ab9f-6011a974f48e"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-3838",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 386300,
  "published_at": "2024-11-15T11:15:05.763+00:00"
}