# CVE-2023-50262: Dompdf possible DoS caused by infinite recursion when parsing SVG images

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.3
- **CVSS:** 5.3 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: Low
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.58% (percentile 76, 2026-11-26)
- **CWE:** CWE-20, CWE-674
- **Aliases:** GHSA-3qx2-6f78-w2j2
- **Published:** 2023-12-13T20:52:56.173Z
- **Modified:** 2026-09-10T03:49:59.235Z

## Who should check

- Projects that depend on Packagist package dompdf/dompdf (\< 2.0.4)
- Anyone running dompdf \< 2.0.4

## Description

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.

## Affected and fixed versions

- Packagist `dompdf/dompdf`: affected \< 2.0.4; fixed 2.0.4 (osv)
- dompdf: \< 2.0.4 (cvelist)

## Mitigation

- Upgrade dompdf/dompdf to 2.0.4 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-50262. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-50262.md
Affected: dompdf/dompdf < 2.0.4
Fixed in: 2.0.4

Steps:
1. Search this machine and project for dompdf/dompdf (Packagist), dompdf: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-50262 being exploited?

There is no confirmed exploitation: CVE-2023-50262 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.58% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-50262?

Medium: CVSS 5.3 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2023-50262?

dompdf/dompdf \< 2.0.4.

### Is there a fix for CVE-2023-50262?

Yes. Fixed in 2.0.4. Upgrade dompdf/dompdf to 2.0.4 or later.

### How do I check if I'm affected by CVE-2023-50262?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/dompdf/dompdf/security/advisories/GHSA-3qx2-6f78-w2j2>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2023-50262>
- patch: <https://github.com/dompdf/dompdf/commit/41cbac16f3cf56affa49f06e8dae66d0eac2b593>
- other: <https://github.com/dompdf/dompdf/blob/v2.0.3/src/Image/Cache.php#L136-L153>
- other: <https://github.com/FriendsOfPHP/security-advisories/blob/master/dompdf/dompdf/CVE-2023-50262.yaml>
- other: <https://github.com/dompdf/dompdf>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-50262>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-3qx2-6f78-w2j2> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2023-50262> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-50262>
