CyberSecBulletin
CVE-2024-25117NVD status: Analyzed

php-svg-lib: Externally Controlled Reference to a Resource in Another Sphere

CVE-2024-25117 is a critical-severity externally controlled reference to a resource in another sphere vulnerability in php-svg-lib from Dompdf, with a CVSS 3.1 base score of 9.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version 0.5.2 as the first without the flaw, so updating php-svg-lib to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.93% chance of exploitation within 30 days, higher than 61% of scored CVEs.

Patch this week

Critical severity: a successful attack would have severe impact.

What to do

  1. Update php-svg-lib to 0.5.2 or a later version.
  2. Read the advisory on github.com for workarounds and exact fixed builds.
  3. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
Dompdfphp-svg-lib< 0.5.2; before 0.5.20.5.2

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.16.8MediumCNA (github.com)
CVSS 3.19.8CriticalNVD

Official description

php-svg-lib is a scalable vector graphics (SVG) file parsing/rendering library. Prior to version 0.5.2, php-svg-lib fails to validate that font-family doesn't contain a PHAR url, which might leads to RCE on PHP < 8.0, and doesn't validate if external references are allowed. This might leads to bypass of restrictions or RCE on projects that are using it, if they do not strictly revalidate the fontName that is passed by php-svg-lib. The `Style::fromAttributes(`), or the `Style::parseCssStyle()` should check the content of the `font-family` and prevents it to use a PHAR url, to avoid passing an invalid and dangerous `fontName` value to other libraries. The same check as done in the `Style::fromStyleSheets` might be reused. Libraries using this library as a dependency might be vulnerable to some bypass of restrictions, or even remote code execution, if they do not double check the value of the `fontName` that is passed by php-svg-lib. Version 0.5.2 contains a fix for this issue.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Externally Controlled Reference to a Resource in Another Sphere

The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.

More Externally Controlled Reference to a Resource in Another Sphere vulnerabilities (CWE-610)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: poc, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Other vulnerabilities in php-svg-lib

All php-svg-lib vulnerabilities

Recent Externally Controlled Reference to a Resource in Another Sphere vulnerabilities

Spotted an error? Tell us.