# CVE-2023-28115: Snappy vulnerable to PHAR deserialization, allowing remote code execution

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 3.72% (percentile 91, 2026-11-26)
- **CWE:** CWE-502
- **Aliases:** GHSA-gq6w-q6wh-jggc
- **Published:** 2023-03-17T18:24:24.000Z
- **Modified:** 2026-09-10T03:50:08.071Z

## Who should check

- Projects that depend on Packagist package knplabs/knp-snappy (\< 1.4.2)
- Anyone running KnpLabs snappy \< 1.4.2

## 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 and fixed versions

- Packagist `knplabs/knp-snappy`: affected \< 1.4.2; fixed 1.4.2 (osv)
- KnpLabs snappy: \< 1.4.2 (cvelist)

## Mitigation

- Upgrade knplabs/knp-snappy to 1.4.2 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-28115. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-28115.md
Affected: knplabs/knp-snappy < 1.4.2
Fixed in: 1.4.2

Steps:
1. Search this machine and project for knplabs/knp-snappy (Packagist), KnpLabs snappy: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-28115 being exploited?

There is no confirmed exploitation: CVE-2023-28115 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 3.72% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-28115?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2023-28115?

knplabs/knp-snappy \< 1.4.2.

### Is there a fix for CVE-2023-28115?

Yes. Fixed in 1.4.2. Upgrade knplabs/knp-snappy to 1.4.2 or later.

### How do I check if I'm affected by CVE-2023-28115?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/KnpLabs/snappy/security/advisories/GHSA-gq6w-q6wh-jggc>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2023-28115>
- vendor: <https://github.com/advisories/GHSA-gq6w-q6wh-jggc>
- patch: <https://github.com/KnpLabs/snappy/pull/469>
- patch: <https://github.com/KnpLabs/snappy/commit/1ee6360cbdbea5d09705909a150df7963a88efd6>
- patch: <https://github.com/KnpLabs/snappy/commit/b66f79334421c26d9c244427963fa2d92980b5d3>
- other: <https://github.com/KnpLabs/snappy/blob/5126fb5b335ec929a226314d40cd8dad497c3d67/src/Knp/Snappy/AbstractGenerator.php#L670>
- other: <https://github.com/KnpLabs/snappy/releases/tag/v1.4.2>
- other: <https://github.com/FriendsOfPHP/security-advisories/blob/master/knplabs/knp-snappy/CVE-2023-28115.yaml>
- other: <https://github.com/KnpLabs/snappy>
- other: <https://huntr.dev/bounties/0bdddc12-ff67-4815-ab9f-6011a974f48e>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-28115>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-gq6w-q6wh-jggc> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2023-28115> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-28115>
