CVE-2021-3838
NoneCVSS
—
EPSS
1.4%
Published
Feb 14, 2023
CISA due date
—
Cloudanix analysis
A long-known flaw in a popular PDF creation tool lets attackers take over the computer that runs it if the tool processes attacker-supplied documents.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- RCE
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Remote code execution flaw in the dompdf PHP PDF generation library allows an attacker to execute arbitrary commands on the host system by supplying specially crafted input during document rendering.
Why it matters to the business
Successful exploitation can lead to complete server takeover, data theft, or deployment of malware; although the issue has been public for over three years with no observed exploitation campaigns, organizations still running the vulnerable library face ongoing operational risk until upgraded.
How an attack unfolds
An attacker identifies a web application or service that uses an unpatched dompdf instance to generate PDFs from user-supplied content, crafts malicious input that triggers the code-execution path, and obtains a shell or executes further payloads on the underlying server.
How to fix it
Upgrade dompdf/dompdf to commit 99aeec1efec9213e87098d42eb09439e7ee0bb6a or later; where an immediate update is not possible, restrict untrusted input to the PDF generation function and isolate the rendering process.
How to confirm the fix worked
Verify that the installed dompdf source matches commit 99aeec1efec9213e87098d42eb09439e7ee0bb6a or a subsequent release; test rendering of known malicious payloads in an isolated environment to confirm the vulnerability is closed.
Typical attack path
- Map publicly reachable endpoints that invoke dompdf rendering
- Submit crafted HTML or font data that exercises the vulnerable code path
- Obtain remote code execution and establish persistence or exfiltrate data
How to detect it
Review web-application and PHP error logs for unusual rendering failures or unexpected process spawns originating from the PDF generation code path; correlate with file-creation events in temporary directories used by dompdf.
What your security team should do
- Immediately update all instances of dompdf to the fixed commit
- Audit applications for any direct use of user-controlled content in PDF generation
- Add dompdf version checks to dependency scanning pipelines
The record
[Unknown description]
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Packagist | dompdf/dompdf | 0 | 2.0.0 |
| Debian:10 | php-dompdf | 0 | 0.6.2+dfsg-3+deb10u1 |
| Debian:10 | php-dompdf | 0 | 0.6.2+dfsg-3+deb10u2 |
| Debian:11 | php-dompdf | 0 | No fix |
| Debian:12 | php-dompdf | 0 | 2.0.2+dfsg-1 |
| Debian:13 | php-dompdf | 0 | 2.0.2+dfsg-1 |
| Ubuntu:20.04:LTS | php-dompdf | 0 | 0.6.2+dfsg-3ubuntu0.20.04.1 |
| Ubuntu:22.04:LTS | php-dompdf | 0 | 0.6.2+dfsg-3.1ubuntu0.1 |
| Ubuntu:Pro:16.04:LTS | php-dompdf | 0 | 0.6.1+dfsg-2ubuntu1+esm1 |
| Ubuntu:Pro:18.04:LTS | php-dompdf | 0 | 0.6.2+dfsg-3ubuntu0.18.04.1~esm1 |