CVE-2023-50262Dompdf possible DoS caused by infinite recursion when parsing SVG images
Dompdf is an HTML to PDF converter for PHP. When parsing SVG images Dompdf performs an initial validation to ensure that paths within the SVG are allowed. One of the validations is that the SVG document does not reference itself. However, prior to version 2.0.4, a recursive chained using two or more SVG documents is not correctly validated. Depending on the system configuration and attack pattern this could exhaust the memory available to the executing process and/or to the server itself. php-svg-lib, when run in isolation, does not support SVG references for `image` elements. However, when used in combination with Dompdf, php-svg-lib will process SVG images referenced by an `image` element. Dompdf currently includes validation to prevent self-referential `image` references, but a chained reference is not checked. A malicious actor may thus trigger infinite recursion by chaining references between two or more SVG images. When Dompdf parses a malicious payload, it will crash due after exceeding the allowed execution time or memory usage. An attacker sending multiple request to a system can potentially cause resource exhaustion to the point that the system is unable to handle incoming request. Version 2.0.4 contains a fix for this issue.
What to do
Fixed builds are available from Debian, Packagist: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 22.04 | php-dompdf | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | php-dompdf | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | php-dompdf | Fix pending | ||
| Ubuntu 14.04 | php-dompdf | Fix pending | ||
| Debian 12 | php-dompdf | Fixed | 2.0.3+dfsg-1+deb12u1 | DEBIAN-CVE-2023-50262 |
| Packagist library | dompdf/dompdf | Fixed | 2.0.4 | GHSA-3qx2-6f78-w2j2 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- dompdf: affected: < 2.0.4
References
- https://github.com/dompdf/dompdf/security/advisories/GHSA-3qx2-6f78-w2j2
- https://github.com/dompdf/dompdf/commit/41cbac16f3cf56affa49f06e8dae66d0eac2b593
- https://github.com/dompdf/dompdf/blob/v2.0.3/src/Image/Cache.php#L136-L153
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.