Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. dompdf/dompdf
  4. ›
  5. CVE-2026-59941

CVE-2026-59941: Dompdf: Uncontrolled resource consumption based on declared BMP dimensions

July 22, 2026

dompdf accepts 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. It was demonstrated that a 169-byte request drove dompdf to 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.

References

  • github.com/advisories/GHSA-8hg6-c449-896m
  • github.com/dompdf/dompdf/commit/7c65e7bbeccf146b2409740405af73949ad129d0
  • github.com/dompdf/dompdf/releases/tag/v3.1.6
  • github.com/dompdf/dompdf/security/advisories/GHSA-8hg6-c449-896m
  • nvd.nist.gov/vuln/detail/CVE-2026-59941

Code Behaviors & Features

Detect and mitigate CVE-2026-59941 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.1.6

Fixed versions

  • 3.1.6

Solution

Upgrade to version 3.1.6 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-400: Uncontrolled Resource Consumption

Source file

packagist/dompdf/dompdf/CVE-2026-59941.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 15 Aug 2026 00:24:35 +0000.