Skip to content
Laskyr

dompdf/dompdf security advisory

CVE-2026-56722: Dompdf: Local file read due to improper file path validation in SVG images encoded as data-URI

CVE-2026-56722 is a medium-severity security vulnerability in the PHP package dompdf/dompdf (CVSS 5.3), published 28 July 2026. It is fixed in 3.1.6; earlier versions are affected. It can be exploited without an account.

medium 5.3 published 2026-07-28 · updated 2026-08-04

Fixed in dompdf/dompdf 3.1.6

This security issue affects dompdf/dompdf versions < 3.1.6. Upgrade to the fixed version for your release line (3.1.6). The newest release, 3.1.6, is not affected.

Affected versions
< 3.1.6
Fixed in
3.1.6
Newest release
3.1.6
Severity
Medium · CVSS 5.3
Type
Security issue
CWE-20
Exploited in the wild
Not on the CISA KEV list
checked 2026-11-04

Is your dompdf/dompdf version affected?

Run composer show dompdf/dompdf in your project, then enter the version. We check it against this and every other known dompdf/dompdf advisory.

Who can exploit CVE-2026-56722

CVSS vector (scored by NVD): CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Your app is only exposed if it uses the affected part of dompdf/dompdf. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

How to fix CVE-2026-56722 in dompdf/dompdf

  1. Find the installed version: composer show dompdf/dompdf. If you never required it yourself, composer why dompdf/dompdf shows which package pulls it in.
  2. Update it: composer update dompdf/dompdf --with-all-dependencies. You need 3.1.6 or newer.
  3. If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example "dompdf/dompdf": "^3.1.6" if you can take that version), or upgrade the package that requires it.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-56722.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for this kind of issue while the upgrade waits. None of it replaces the fix.

The CVE-2026-56722 advisory

Dompdf is an HTML to PDF converter for PHP. In versions 3.15 and prior, aAn attacker who controls the HTML input can bypass this restriction by embedding a target file path inside an SVG image delivered through a  data:  URI, because dompdf processes the SVG twice and the second pass does not enforce the same protections as the first. When rendering, dompdf hands the SVG to the separate  php-svg-lib  library with external references forced on, and that library has no knowledge of the chroot directory, blocks only the  phar://  scheme, and ultimately reads the referenced file with no path or protocol validation. This lets an external, unauthenticated attacker read arbitrary image files from the server's file system in the default configuration. This issue has been fixed in version 3.16.

Description from the CVE record, published by GitHub (the CVE Numbering Authority), via the NVD entry for CVE-2026-56722. Advisory title: “Dompdf: Local file read due to improper file path validation in SVG images encoded as data-URI”.

References

Other dompdf/dompdf advisories

Related

Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.

Ask about a fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit