Skip to main content

CVE-2023-50251: CWE-674: Uncontrolled Recursion in dompdf php-svg-lib

Medium
VulnerabilityCVE-2023-50251cvecve-2023-50251cwe-674
Published: Tue Dec 12 2023 (12/12/2023, 20:37:23 UTC)
Source: CVE
Vendor/Project: dompdf
Product: php-svg-lib

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.

AI-Powered Analysis

AILast updated: 07/08/2025, 06:57:08 UTC

Technical Analysis

CVE-2023-50251 is a medium-severity vulnerability identified in the php-svg-lib library, a component used for parsing and rendering SVG files within the dompdf project. The vulnerability arises from uncontrolled recursion when parsing attributes of the <use> tag inside an SVG document. Specifically, versions of php-svg-lib prior to 0.5.1 do not properly handle recursive references in SVG elements, leading to infinite recursion. This uncontrolled recursion can cause the process executing the SVG rendering to exhaust available memory resources, potentially leading to a denial of service (DoS) condition. An attacker can exploit this vulnerability remotely by sending specially crafted SVG payloads that trigger the infinite recursion during rendering. Since the attack vector is network-based (AV:N), requires no privileges (PR:N), and no user interaction (UI:N), it is relatively easy to exploit. The impact is limited to availability (A:L) with no direct confidentiality or integrity compromise. The vulnerability was patched in version 0.5.1 of php-svg-lib, which includes fixes to prevent infinite recursion during SVG attribute parsing. No known exploits are currently reported in the wild, but the vulnerability poses a risk to any system using vulnerable versions of php-svg-lib for SVG rendering, especially in web applications that accept user-supplied SVG content or generate PDFs with embedded SVGs via dompdf. The CVSS v3.1 base score is 5.3, reflecting a medium severity level due to the potential for resource exhaustion and denial of service without privilege or user interaction requirements.

Potential Impact

For European organizations, this vulnerability can lead to denial of service conditions on web servers or applications that utilize php-svg-lib versions prior to 0.5.1, particularly those employing dompdf for PDF generation with embedded SVG content. Resource exhaustion attacks could degrade service availability, impacting business continuity, customer experience, and potentially leading to financial losses or reputational damage. Organizations in sectors with high reliance on document generation or graphic rendering, such as publishing, finance, government, and e-commerce, may be particularly affected. Additionally, if exploited in public-facing applications, attackers could disrupt services at scale by sending multiple malicious SVG payloads, causing server crashes or degraded performance. While the vulnerability does not directly compromise data confidentiality or integrity, the resulting downtime or service unavailability can have cascading effects on operational processes and compliance with service-level agreements (SLAs).

Mitigation Recommendations

European organizations should immediately verify the versions of php-svg-lib used in their environments, especially within dompdf implementations. Upgrading php-svg-lib to version 0.5.1 or later is the primary and most effective mitigation step. For environments where immediate upgrade is not feasible, implementing input validation and sanitization to block or filter SVG files containing <use> tags or recursive references can reduce risk. Rate limiting and web application firewall (WAF) rules can help mitigate potential denial of service attempts by limiting the number of SVG rendering requests from a single source. Monitoring application logs for unusual spikes in SVG rendering errors or resource usage can provide early detection of exploitation attempts. Additionally, isolating the SVG rendering process in a sandboxed or resource-limited environment can prevent system-wide resource exhaustion. Regular patch management and vulnerability scanning should be enforced to detect and remediate vulnerable library versions promptly.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2023-12-05T20:42:59.377Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682f725b0acd01a2492647ec

Added to database: 5/22/2025, 6:52:11 PM

Last enriched: 7/8/2025, 6:57:08 AM

Last updated: 7/30/2025, 1:45:53 AM

Views: 15

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats