CVE-2023-50251 php-svg-lib possible DoS caused by infinite recursion when parsing SVG document
An attacker can cause a denial of service via infinite recursion in php-svg-lib by sending a crafted SVG document, exhausting server resources.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-50251?
CVE-2023-50251 is a medium-severity denial of service vulnerability in dompdf php-svg-lib, published on 12 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
php-svg-lib is an SVG file parsing / rendering library. Prior to version 0.5.1, when parsing the attributes passed to a `use` tag inside an svg document, an attacker can cause the system to go to an infinite recursion. Depending on the system configuration and attack pattern this could exhaust the memory available to the executing process and/or to the server itself. An attacker sending multiple request to a system to render the above payload can potentially cause resource exhaustion to the point that the system is unable to handle incoming request. Version 0.5.1 contains a patch for this issue.
Weakness: CWE-674
Which versions are affected by CVE-2023-50251?
2 open source packages ship an affected version, including phenx/php-svg-lib. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
phenx/php-svg-lib Packagist | All versions | 0.5.1 |
phenx/php-svg-lib Packagist | All versions | 0.5.1 |
Products include Dompdf Php-Svg-Lib.
How do I fix CVE-2023-50251?
Upgrade phenx/php-svg-lib to 0.5.1 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2023-50251 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-50251 exists.
Other vulnerabilities in dompdf php-svg-lib
Sources
Also known as DEBIAN-CVE-2023-50251, GHSA-ff5x-7qg5-vwf2.