Snappy vulnerable to PHAR deserialization, allowing remote code execution
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-502.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| KnpLabs | snappy | before 1.4.2 | 1.4.2 | Patch available | CNA |
| — | knplabs/knp-snappy (Packagist) | before 1.4.2 | 1.4.2 | Patch available | GHSA-gq6w-q6wh-jggc |
- snappy VendorKnpLabs Affected before 1.4.2 Fixed in 1.4.2 Patch available CNA
- knplabs/knp-snappy (Packagist) Vendor— Affected before 1.4.2 Fixed in 1.4.2 Patch available GHSA-gq6w-q6wh-jggc
Remediation
- Fix · CNA snappy (KnpLabs) Fixed in 1.4.2
- Fix · GHSA-gq6w-q6wh-jggc knplabs/knp-snappy (Packagist) Fixed in 1.4.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2023-28115
- 2026-10-03 Alias added: GHSA-gq6w-q6wh-jggc
References
Patch 3
Advisory 2
Other 5
- https://github.com/KnpLabs/snappy/blob/5126fb5b335ec929a226314d40cd8dad497c3d67/src/Knp/Snappy/AbstractGenerator.php#L670
- https://github.com/KnpLabs/snappy/releases/tag/v1.4.2
- https://github.com/FriendsOfPHP/security-advisories/blob/master/knplabs/knp-snappy/CVE-2023-28115.yaml
- https://github.com/KnpLabs/snappy
- https://huntr.dev/bounties/0bdddc12-ff67-4815-ab9f-6011a974f48e
More KnpLabs Snappy vulnerabilities
- TI-2023-21930 Unsafe deserialization in knplabs/knp-snappy CVSS 3.1CRITICAL 9.8
Sources
- CVE-2023-28115 · CVE Program
- CVE-2023-28115 · NVD
- FIRST EPSS
- GHSA-gq6w-q6wh-jggc · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences