Skip to content
OpenAdvisories
Critical · 9.8 CVE-2023-28115 EUVD-2023-1015GHSA-gq6w-q6wh-jggc

Snappy vulnerable to PHAR deserialization, allowing remote code execution

Published Mar 17, 2023 · Updated Feb 25, 2025 · Assigned by GitHub_M

Description

Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Prior to version 1.4.2, Snappy is vulnerable to PHAR deserialization due to a lack of checking on the protocol before passing it into the `file_exists()` function. If an attacker can upload files of any type to the server he can pass in the phar:// protocol to unserialize the uploaded file and instantiate arbitrary PHP objects. This can lead to remote code execution especially when snappy is used with frameworks with documented POP chains like Laravel/Symfony vulnerable developer code. If a user can control the output file from the `generateFromHtml()` function, it will invoke deserialization. This vulnerability is capable of remote code execution if Snappy is used with frameworks or developer code with vulnerable POP chains. It has been fixed in version 1.4.2.

Affected products

VendorProductAffectedFixed
KnpLabs snappy < 1.4.2 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 11 civicrm No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu Pro 22.04 LTS civicrm No fix yet —
Ubuntu Pro 20.04 LTS civicrm No fix yet —
Ubuntu Pro 18.04 LTS civicrm No fix yet —
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 16.04 LTS civicrm No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
Packagist knplabs/knp-snappy < 1.4.2 1.4.2 GHSA-gq6w-q6wh-jggc

References