CVE-2026-59941
PoC largeUnauthenticated BMP memory-amplification DoS in dompdf 3.15 and prior
Dompdf, a PHP HTML-to-PDF converter, in versions 3.15 and earlier trusts the dimensions declared in a BMP image header and never bounds width x height before allocating a pixel canvas through GD (imagecreatetruecolor), so a tiny BMP can trigger outsized allocations (CWE-400, uncontrolled resource consumption). An attacker triggers it by embedding an inlined data:image/bmp;base64 URI in HTML that the application converts with dompdf — no upload, remote fetch, or chroot-reachable file is required — and a ~170-byte request was measured to drive ~412 MB peak memory and ~4.8 seconds of CPU versus ~34 MB for a benign request, roughly 12x amplification per request. The attacker gains no code execution or data access, but can repeatedly exhaust memory and CPU on the PDF-rendering path, degrading service or, with enough concurrent requests, causing denial of service (CVSS 4.0 rates availability impact as low, with no confidentiality or integrity impact). Any PHP application that converts attacker-controlled HTML to PDF using dompdf 3.15 or earlier is affected. No in-the-wild exploitation is currently known; a public security advisory with proof-of-concept measurements exists, and the issue is fixed in version 3.16.
What to do: Upgrade dompdf to version 3.16 or later. If upgrading is not immediately possible, sanitize or restrict image sources in HTML sent to dompdf (especially data: image URIs), validate and bound BMP dimensions before rendering, and limit concurrent PDF-render processes to contain memory spikes. Audit whether your application converts user-supplied HTML (invoices, uploads, generated reports) through dompdf, since only those attacker-reachable flows expose you to this flaw.
| dompdf project dompdf | all versions 3.15 and prior (fixed in 3.16) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
Dompdf is an HTML to PDF converter for PHP. Versions 3.15 and prior accept a BMP image and generates a PDF-compatible PNG based only on its declared header dimensions and never bounds width × height before the image is converted through GD. A 58-byte BMP whose header declares e.g. 6000×6000 is accepted and later drives imagecreatetruecolor($width, $height) (and PHP's native BMP decoder) to allocate the full pixel canvas. A payload can fit in a single HTTP request: the BMP can be inlined as a data:image/bmp;base64,… URI inside attacker-controlled HTML, so no upload, no remote fetch, and no chroot-reachable file is required. I measured a 169-byte request driving a dompdf render to ~412 MB peak RSS and ~4.8 s of CPU/wall time, versus ~34 MB for an identically-sized benign request — roughly a 12× memory amplification per request, repeatable and unauthenticated. This issue has been fixed in version 3.16.
- Vendors
- dompdf project
- Products
- dompdf
- Weakness
- CWE-400
- Vector
- 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
In the news0 stories
No ingested article mentions this CVE yet.