CVE-2023-28115 json
Snappy vulnerable to PHAR deserialization, allowing remote code execution
published 2023-03-17 3 y ago modified 2026-09-10 1 mo ago also GHSA-gq6w-q6wh-jggc , EUVD-2023-1015
- cvss
- 9.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.8%
- EPSS 2.8% chance of exploitation in 30 days, percentile 86%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- packagist knplabs/knp-snappy 1.4.2
- knplabs snappy 1.4.2
- github.com/KnpLabs/snappy@1ee6360 commit
- github.com/KnpLabs/snappy@b66f793 commit
- github.com/KnpLabs/snappy#469 pull request
- github.com/KnpLabs/snappy/releases/tag/v1.4.2 release
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- total
- Assessed
- 20 mo ago
Exploit prediction
2.76% chance of exploitation in the next 30 days, higher than 86% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/KnpLabs/snappy/security/advisories/GHSA-gq6w-q6wh-jggc referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| packagist | knplabs/knp-snappy | <1.4.2 |
1.4.2 |
Affected products
- KnpLabs snappy
Classification
- Weakness
-
- CWE-502 Deserialization of Untrusted Data
References
-
github.com
/KnpLabs/snappy/pull/469
web, patch
-
github.com
/KnpLabs/snappy/commit/1ee6360cbdbea5d09705909a150df7963a88efd6
web, patch
-
github.com
/KnpLabs/snappy/commit/b66f79334421c26d9c244427963fa2d92980b5d3
web, patch
-
github.com
/KnpLabs/snappy/security/advisories/GHSA-gq6w-q6wh-jggc
web, exploit, vendor-advisory
-
github.com
/KnpLabs/snappy/blob/5126fb5b335ec929a226314d40cd8dad497c3d67/src/Knp/Snappy/AbstractGenerator.php#L670
web, product
-
github.com
/KnpLabs/snappy/releases/tag/v1.4.2
web, release-notes
-
nvd.nist.gov
/vuln/detail/CVE-2023-28115
advisory
-
github.com
/FriendsOfPHP/security-advisories/blob/master/knplabs/knp-snappy/CVE-2023-28115.yaml
web
-
github.com
/KnpLabs/snappy
package
-
github.com
/advisories/GHSA-gq6w-q6wh-jggc
advisory
-
huntr.dev
/bounties/0bdddc12-ff67-4815-ab9f-6011a974f48e
web
Sources
- CVE List CVE-2023-28115
- GitHub Advisory GHSA-gq6w-q6wh-jggc
- NVD CVE-2023-28115
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.