CVE-2023-28115
CRITICAL 9.8CVSS 3.1PHAR deserialization allowing remote code execution
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.
- Published
- 17 Mar 2023
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-502
- Also known as
- GHSA-gq6w-q6wh-jggc
- Sources
- NVDJSONOSV GHSA-gq6w-q6wh-jggcJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | knplabs | snappycpe:2.3:a:knplabs:snappy:*:*:*:*:*:*:*:* |
< 1.4.2 | 1.4.2 |
| OSV | Packagist | knplabs/knp-snappy | < 1.4.2 | 1.4.2 |
References
- https://github.com/KnpLabs/snappy/blob/5126fb5b335ec929a226314d40cd8dad497c3d67/src/Knp/Snappy/AbstractGenerator.php#L670 · Product, WEB
- https://github.com/KnpLabs/snappy/commit/1ee6360cbdbea5d09705909a150df7963a88efd6 · Patch, WEB
- https://github.com/KnpLabs/snappy/commit/b66f79334421c26d9c244427963fa2d92980b5d3 · Patch, WEB
- https://github.com/KnpLabs/snappy/pull/469 · Patch, WEB
- https://github.com/KnpLabs/snappy/releases/tag/v1.4.2 · Release Notes, WEB
- https://github.com/KnpLabs/snappy/security/advisories/GHSA-gq6w-q6wh-jggc · Exploit, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2023-28115 · ADVISORY
- https://github.com/FriendsOfPHP/security-advisories/blob/master/knplabs/knp-snappy/CVE-2023-28115.yaml · WEB
- https://github.com/KnpLabs/snappy · PACKAGE
- https://github.com/advisories/GHSA-gq6w-q6wh-jggc · ADVISORY
- https://huntr.dev/bounties/0bdddc12-ff67-4815-ab9f-6011a974f48e · WEB
History
- 25 Nov 2026 20:36 UTC · NVD: first stored (published 17 Mar 2023)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 17 Mar 2023)