LiveActive security incident?Get immediate response
CVE Record

CVE-2021-3838: PHAR Deserialization in dompdf/dompdf

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.

CriticalCVSS 9.8Not KEV-listedUpdated
Glexia's TakeAutomated analysiscritical

Security readout for executives and security teams

Plain-English summary

DomPDF could be tricked into reading an uploaded PHAR file as serialized PHP data. If an application lets attackers upload arbitrary files and feeds attacker-controlled paths into DomPDF, this can become remote code execution, especially in PHP frameworks with usable object chains.

Executive priority

Treat this as urgent where DomPDF supports customer-supplied content or uploads. The impact can be full server compromise, but priority should be based on whether both upload and attacker-influenced rendering paths exist.

Technical view

Before DomPDF 2.0.0, protocol validation was missing before file_get_contents(). An attacker able to upload arbitrary files could reference phar:// content, triggering PHP object deserialization. The CVE maps to CWE-502 and carries CVSS 9.8 for network, unauthenticated, no-user-interaction impact.

Likely exposure

Exposure is most likely in PHP applications using dompdf/dompdf below 2.0.0 where untrusted users can upload files and influence file paths, URLs, or HTML passed into PDF rendering.

Exploitation context

The bundle does not show CISA KEV listing or other evidence of active exploitation. The reported path to impact requires arbitrary file upload plus a way to make DomPDF process attacker-controlled phar:// input.

Researcher notes

The strongest evidence is the CVE description, Huntr report, and DomPDF commit. The bundle identifies the fixed threshold as 2.0.0 but does not provide deployment-specific exploit telemetry. Validate reachability before assuming practical exposure.

Mitigation direction

  • Upgrade dompdf/dompdf to version 2.0.0 or later, following vendor guidance.
  • Apply the referenced DomPDF protocol validation fix if direct upgrading is blocked.
  • Restrict uploads to expected file types and storage locations.
  • Prevent untrusted protocol strings or file paths from reaching PDF rendering code.
  • Review framework dependencies for dangerous deserialization gadget chains.

Validation and detection

  • Inventory Composer lockfiles for dompdf/dompdf versions below 2.0.0.
  • Find PDF rendering flows that consume user-supplied HTML, URLs, or file paths.
  • Confirm upload controls block arbitrary file types and untrusted storage paths.
  • Check whether phar:// inputs are rejected before DomPDF file reads.
  • Review logs for unusual PDF rendering failures involving unexpected protocols.
Prepared
Confidence
medium
Sources
4

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-502: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-3838 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Critical
CVSS
9.8 (3.0)
Known Exploited
No
Published

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
3Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
9.8CVSS 3.0CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H3.95.9Primary CVE score

Vulnerability scoring details

Base CVSS 3.0 score

9.8Critical
CVSS 3.0 vector shape for CVE-2021-3838Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
dompdfdompdf/dompdfunspecifiedListed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-502 · source CWE mapping

Deserialization of Untrusted Data

Deserialization of Untrusted Data represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.