Skip to main content

Dompdf CVE-2026-55554

| EUVDEUVD-2026-50011 LOW
Improper Input Validation (CWE-20)
2026-07-22 https://github.com/dompdf/dompdf GHSA-wvh6-f5jh-8gw4
2.3
CVSS 4.0 · Vendor: https://github.com/dompdf/dompdf
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted HTML with malicious absolute img src path
  2. Delivery
    Dompdf invokes validateLocalUri() on attacker-supplied resource URI
  3. Exploit
    strpos() prefix check incorrectly passes for sibling directory
  4. Execution
    PHP reads file outside configured chroot boundary
  5. Persist
    Sensitive file content embedded in generated PDF output
  6. Impact
    PDF streamed back to attacker over HTTP

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Exploitation requires that the attacker controls a portion of the HTML content rendered by Dompdf - specifically the value of resource-loading attributes such as src on <img> tags or equivalent resource references within the HTML document. This is the explicit condition stated in the advisory: 'an attacker that controls a portion of the rendered HTML.' Beyond HTML input control, the following conditions must hold: (1) the application must configure Dompdf with a setChroot() restriction (without this feature, the vulnerability has no security boundary to bypass); (2) sensitive files must exist in directories on the server filesystem that share a string prefix with the chroot path but reside outside it - for example, chroot /var/www/app and target data in /var/www/app-secrets; (3) the PHP process must have OS-level read access to the target files. Exploitation is limited by: the attacker must know or correctly guess the absolute path of the target file; applications that sanitize or discard absolute local file URIs from user-supplied HTML before passing to Dompdf are not vulnerable; and deployments where Dompdf receives only internally generated, non-user-influenced HTML are not at risk.

Impact

No vendor-supplied CVSS score or EPSS data is available for this CVE; risk assessment is derived from the description, commit diff, PoC, and tag metadata. The impact is limited to information disclosure - arbitrary file read relative to the PHP process's filesystem permissions - rather than code execution, which bounds severity. However, a fully functional proof-of-concept is included in the GitHub Security Advisory, significantly lowering the bar to exploitation. Real-world risk is moderate-to-high for applications that (a) pass user-controlled HTML to Dompdf and (b) have sensitive files (credentials, configuration, secrets) residing in filesystem directories whose absolute paths share a name prefix with the configured chroot. Applications where Dompdf renders only internally generated HTML, or where no attacker-influenced content reaches the library, face negligible risk. The absence of a CISA KEV entry and lack of EPSS data suggest no confirmed widespread or automated exploitation at time of analysis, though the PoC lowers the effort threshold considerably.

Exploit ScenarioDerived

An attacker submits a crafted HTML document via HTTP POST to a web endpoint that passes user-supplied HTML to Dompdf for PDF generation, with the chroot set to /home/dompdf/web/. The HTML includes an <img src='/home/dompdf/web-admin/secret.jpg'> tag referencing a file in the sibling directory outside the chroot; because strpos('/home/dompdf/web-admin/secret.jpg', '/home/dompdf/web') === 0 evaluates to true, the validation passes and the file is embedded in the returned PDF. A working proof-of-concept demonstrating this exact technique is published in GitHub Security Advisory GHSA-wvh6-f5jh-8gw4.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 22, 2026

Dompdf's chroot validation logic in versions before 3.1.6 can be bypassed by an attacker who controls HTML content rendered into a PDF, allowing files outside the configured chroot directories to be read and embedded in the output. The root cause is a flawed strpos() prefix check in validateLocalUri() that fails to enforce directory boundaries after realpath() strips trailing slashes, enabling sibling directories like /var/www-admin to satisfy a chroot configured as /var/www. A publicly available proof-of-concept exploit is included in the GitHub Security Advisory GHSA-wvh6-f5jh-8gw4; no active exploitation is recorded in CISA KEV, and upgrading to v3.1.6 fully resolves the issue.

RemediationAI

Upgrade Dompdf to version 3.1.6 or later via Composer (composer update dompdf/dompdf). The patch at https://github.com/dompdf/dompdf/commit/1b3b61ec4f6962678e56ee8a42920b4f835ab006 fixes validateLocalUri() by appending a directory separator before the prefix comparison - $normalizedChrootPath = rtrim($chrootPath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR - and then using strncmp() rather than strpos(), ensuring sibling directories with matching name prefixes are correctly rejected. If immediate patching is not possible, restrict what HTML content is supplied to Dompdf so that resource references (img src, href, etc.) are either stripped of absolute local paths or validated against an allowlist before being passed to the library; this eliminates attacker control over the file paths that trigger the vulnerable check, though this workaround is application-specific and fragile. Additionally, audit the filesystem layout around your configured chroot directories and ensure no sensitive files reside in adjacent sibling directories sharing a name prefix with the chroot path. Upgrading to 3.1.6 remains the only definitive fix.

Affected VersionsENISA

dompdf < 3.1.6

Affected Packages

composer dompdf/dompdf fix: 3.1.6
euvd dompdf fix: 3.1.6

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Dompdf (pkg:composer/dompdf/dompdf) is a PHP library that converts HTML and CSS into PDF documents, widely used in web applications for receipt generation, reporting, and document export. It provides a chroot restriction feature via Options::setChroot() to limit which local filesystem paths may be accessed when loading embedded resources (images, fonts, stylesheets). The vulnerable validateLocalUri() method in src/Options.php first normalizes the supplied file path with PHP's realpath(), which strips trailing directory separators. The subsequent check strpos($realfile, $chrootPath) === 0 tests only that $chrootPath is a string prefix of $realfile at position zero - not that it is a proper directory ancestor. This conflates string-prefix matching with filesystem containment, classified under CWE-20 (Improper Input Validation). A chroot normalized to /var/www will therefore also match /var/www2, /var/www-admin, and /var/www_backup, all of which are completely separate directories outside the intended sandbox.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/dompdf/dompdf) PRIMARY 2.3 LOW
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

Exploited via network HTTP POST with no required privileges or user interaction; impact is confidentiality-only file read outside chroot, no integrity or availability effect.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/dompdf/dompdf).

CVSS VectorVendor: https://github.com/dompdf/dompdf

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Jul 28, 2026 - 20:22 NVD
2.3 (LOW)

DescriptionCVE.org

Summary

The chroot check for local files uses a prefix string check to enforce chroot boundaries. The simple string comparison it performs allows paths like /var/www/root_secret/file.html when chroot is /var/www/root.

This allows attacker-controlled document paths/resources to bypass intended local file restrictions.

Details

The validateLocalUri() method is used to check if a local file is within an allowed chroot directory. After normalization with realpath(), this check is performed with a strpos() comparison:

    public function validateLocalUri(string $uri)
    {
        ...
        $realfile = realpath(str_replace("file://", "", $uri));
        ...
        foreach ($dirs as $chrootPath) {
            $chrootPath = realpath($chrootPath);
            if ($chrootPath !== false && strpos($realfile, $chrootPath) === 0) {
                $chrootValid = true;

Due to the normalization, the $chrootPath string does not have a terminating directory separator (/) appended. Because of this, the strpos() check only validates that $chrootPath is a _prefix_ of $realfile. This allows access to folders with similar names that fall outside of the defined chroot restrictions.

For example, a chroot setting of /var/www/ would be normalized to /var/www, removing the trailing /. During strpos(), a $chrootPath of /var/www will also match a $realfile starting with /var/www2, /var/www-admin, or /var/www_backup, despite these being different directories.

PoC

With a directory structure similar to:

/home/dompdf/
  |--> web/
        |--> pdf.php
        |--> cat0.jpg
  |--> web-admin/
        |--> cat1.jpg

And web-accessible Dompdf functionality similar to the following (poc.html):

<?php
require 'vendor/autoload.php';
use Dompdf\Dompdf;
use Dompdf\Options;

$options = new Options();
$options->setChroot(['/home/dompdf/web/']);
$dompdf = new Dompdf($options);

$dompdf->loadHtml($_POST['html']);
$dompdf->render();
$dompdf->stream();
?>

A malicious actor can exploit the vulnerability with the following script:

$html = <<<HTML
<!DOCTYPE html>
<html>
    <body>
        <p>within chroot</p>
            <img src="/home/dompdf/web/cat0.jpg">
        <p>outside of chroot</p>
            <img src="/home/dompdf/web-admin/cat1.jpg">
    </body>
</html>
HTML;

$url = 'http://example.com/poc.php';
$data = ['html' => $html];
$headers = ["Content-type: application/x-www-form-urlencoded"];

// use key 'http' even if you send the request to https://...
$options = [
    'http' => [
        'header' => $headers,
        'method' => 'POST',
        'content' => http_build_query($data),
        'ignore_errors' => true,
    ],
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);

When the PDF is generated, both jpg files are loaded successfully despite the cat1.jpg file being outside of the allowed chroot.

Impact

An attacker that controls a portion of the rendered HTML could leverage this vulnerability to bypass chroot restrictions and access potentially sensitive files from outside of the allowed directories.

Threat Intelligence Overview

EPSS Score
0.3%
Top 80% exploitable
Prevalence
Medium
widely used PHP PDF generation library, common in web apps
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +12
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy