Uncontrolled Recursion Affecting phenx/php-svg-lib package, versions <0.5.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.08% (38th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-PHENXPHPSVGLIB-6125588
  • published14 Dec 2023
  • disclosed13 Dec 2023
  • creditUnknown

Introduced: 13 Dec 2023

CVE-2023-50251  (opens in a new tab)
CWE-674  (opens in a new tab)

How to fix?

Upgrade phenx/php-svg-lib to version 0.5.1 or higher.

Overview

phenx/php-svg-lib is a library to read, parse and export to PDF SVG files.

Affected versions of this package are vulnerable to Uncontrolled Recursion via the parsing of attributes in an SVG use tag, which can lead to infinite recursion. An attacker can cause a denial of service by crafting an SVG document that triggers this recursive behavior. This is only exploitable if the id attribute in the use tag is the same as the href or xlink:href link attribute, causing the parser to enter an infinite loop until memory resources are exhausted.

PoC


<svg width="200" height="200"
  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <use id="selfref" xlink:href="#selfref" />
</svg>

References

CVSS Scores

version 3.1