CVE-2023-28115 Snappy vulnerable to PHAR deserialization, allowing remote code execution
- Published
- Updated
- Exploit status
- Proof-of-concept only
- CISA SSVC
- No known exploitation · automatable: yes · technical impact: total
- Technology
- PHPLaravelUbuntuDebian
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.
Upgrade path
8 packages: 2 fixed, 6 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/civicrm(Debian 11) | = 5.33.2+dfsg1-1; = 5.50.1+dfsg1-1; = 5.50.3+dfsg1-1; = 5.52.2+dfsg1-1 +3 more | No fix listed | No fix yet |
| ubuntu/civicrm(Ubuntu 22.04) | All versions | No fix listed | No fix yet |
| ubuntu/civicrm(Ubuntu Pro 16.04) | = 4.7.1+dfsg-1; = 4.7.1+dfsg-2; = 4.7.1+dfsg-2ubuntu1; = 4.7.1+dfsg-2ubuntu1+esm1 +1 more | No fix listed | No fix yet |
| ubuntu/civicrm(Ubuntu Pro 18.04) | = 4.7.23+dfsg-1ubuntu1; = 4.7.24+dfsg-1ubuntu1; = 4.7.30+dfsg-1ubuntu1; = 4.7.30+dfsg-1ubuntu1+esm1 +1 more | No fix listed | No fix yet |
| ubuntu/civicrm(Ubuntu Pro 20.04) | = 5.11.0+dfsg-1; = 5.18.1+dfsg-1; = 5.20.3+dfsg-1; = 5.21.0+dfsg-1 +4 more | No fix listed | No fix yet |
| ubuntu/civicrm(Ubuntu Pro 22.04) | = 5.33.2+dfsg1-1; = 5.33.2+dfsg1-1build1; = 5.33.2+dfsg1-1ubuntu1; = 5.33.2+dfsg1-1ubuntu1+esm1 +1 more | No fix listed | No fix yet |
| knplabs snappy | < 1.4.2; = < 1.4.2 | 1.4.2 | Fixed |
| knplabs/knp-snappy(Packagist) | < 1.4.2; = 0.1.0; = 0.1.1; = 0.1.2 +24 more | 1.4.2 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| knplabs/knp-snappy(Packagist) | < 1.4.2 | 1.4.2 |
| knplabs/knp-snappy(Packagist) | = 0.1.0 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.1.1 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.1.2 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.2.0 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.2.1 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.3.0 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.3.1 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.3.2 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.3.3 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.3.4 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.4 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.4.1 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.4.2 | No fix listed |
| knplabs/knp-snappy(Packagist) | = 0.4.3 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v0.5.0 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.0 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.0.1 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.0.2 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.0.3 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.0.4 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.1.0 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.2.0 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.2.1 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.3.0 | No fix listed |
Show 36 more
| Product | Affected versions | Fixed in |
|---|---|---|
| knplabs/knp-snappy(Packagist) | = v1.3.1 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.4.0 | No fix listed |
| knplabs/knp-snappy(Packagist) | = v1.4.1 | No fix listed |
| debian/civicrm(Debian:11) | All versions | No fix listed |
| debian/civicrm(Debian:11) | = 5.33.2+dfsg1-1 | No fix listed |
| debian/civicrm(Debian:11) | = 5.50.1+dfsg1-1 | No fix listed |
| debian/civicrm(Debian:11) | = 5.50.3+dfsg1-1 | No fix listed |
| debian/civicrm(Debian:11) | = 5.52.2+dfsg1-1 | No fix listed |
| debian/civicrm(Debian:11) | = 5.53.0+dfsg1-1 | No fix listed |
| debian/civicrm(Debian:11) | = 5.68.1+dfsg1-1 | No fix listed |
| knplabs snappy | = < 1.4.2 | No fix listed |
| ubuntu/civicrm(Ubuntu:22.04) | All versions | No fix listed |
| knplabs snappy | < 1.4.2 | 1.4.2 |
| ubuntu/civicrm(Ubuntu:Pro:16.04) | All versions | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:16.04) | = 4.7.1+dfsg-1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:16.04) | = 4.7.1+dfsg-2 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:16.04) | = 4.7.1+dfsg-2ubuntu1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:16.04) | = 4.7.1+dfsg-2ubuntu1+esm1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:18.04) | All versions | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:18.04) | = 4.7.23+dfsg-1ubuntu1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:18.04) | = 4.7.24+dfsg-1ubuntu1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:18.04) | = 4.7.30+dfsg-1ubuntu1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:18.04) | = 4.7.30+dfsg-1ubuntu1+esm1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:20.04) | All versions | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:20.04) | = 5.11.0+dfsg-1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:20.04) | = 5.18.1+dfsg-1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:20.04) | = 5.20.3+dfsg-1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:20.04) | = 5.21.0+dfsg-1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:20.04) | = 5.21.1+dfsg-1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:20.04) | = 5.21.2+dfsg-1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:20.04) | = 5.21.2+dfsg-1ubuntu0.1~esm1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:22.04) | All versions | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:22.04) | = 5.33.2+dfsg1-1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:22.04) | = 5.33.2+dfsg1-1build1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:22.04) | = 5.33.2+dfsg1-1ubuntu1 | No fix listed |
| ubuntu/civicrm(Ubuntu:Pro:22.04) | = 5.33.2+dfsg1-1ubuntu1+esm1 | No fix listed |
References
- https://github.com/KnpLabs/snappy/security/advisories/GHSA-gq6w-q6wh-jggc exploit issue-tracking vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- https://github.com/KnpLabs/snappy/pull/469 issue-tracking patch
- https://github.com/KnpLabs/snappy/commit/1ee6360cbdbea5d09705909a150df7963a88efd6 issue-tracking patch
- https://github.com/KnpLabs/snappy/commit/b66f79334421c26d9c244427963fa2d92980b5d3 patch
- github.com exploit
- github.com product
- https://github.com/KnpLabs/snappy/blob/5126fb5b335ec929a226314d40cd8dad497c3d67/src/Knp/Snappy/AbstractGenerator.php#L670 product
- https://github.com/KnpLabs/snappy/releases/tag/v1.4.2 release-notes
- github.com vendor-advisory
- huntr.dev exploit
- security-tracker.debian.org vendor-advisory
- Ubuntu CVE tracker issue-tracking vendor-advisory
- www.cve.org issue-tracking