Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2023-41330

CRITICAL 9.8EPSS 84%

Unsafe deserialization in knplabs/knp-snappy

Also known as GHSA-92rv-4j2h-8mjj

Mitigation

  • Upgrade knplabs/knp-snappy to 1.4.3 or later.

Who should check

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

Vulnerability facts

Affected
knplabs/knp-snappy < 1.4.3
Fixed in
1.4.3
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
9.8 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 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
EPSS
2.33% chance of exploitation in 30 days (percentile 84, 2026-11-26)
CWE
CWE-502
Published
Modified

Description

knplabs/knp-snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. ## Issue On March 17th the vulnerability CVE-2023-28115 was disclosed, allowing an attacker to gain remote code execution through PHAR deserialization. Version 1.4.2 added a check `if (\strpos($filename, 'phar://') === 0)` in the `prepareOutput` function to resolve this CVE, however if the user is able to control the second parameter of the `generateFromHtml()` function of Snappy, it will then be passed as the `$filename` parameter in the `prepareOutput()` function. In the original vulnerability, a file name with a `phar://` wrapper could be sent to the `fileExists()` function, equivalent to the `file_exists()` PHP function. This allowed users to trigger a deserialization on arbitrary PHAR files. To fix this issue, the string is now passed to the `strpos()` function and if it starts with `phar://`, an exception is raised. However, PHP wrappers being case insensitive, this patch can be bypassed using `PHAR://` instead of `phar://`. A successful exploitation of this vulnerability allows executing arbitrary code and accessing the underlying filesystem. The attacker must be able to upload a file and the server must be running a PHP version prior to 8. This issue has been addressed in commit `d3b742d61a` which has been included in version 1.4.3. Users are advised to upgrade. Users unable to upgrade should ensure that only trusted users may submit data to the `AbstractGenerator->generate(...)` function.

Affected and fixed versions

Package / productAffectedFixedSource
Packagist knplabs/knp-snappy< 1.4.31.4.3osv
KnpLabs snappy< 1.4.3—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

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

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

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.

References

FAQ

Is CVE-2023-41330 being exploited?

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

How serious is CVE-2023-41330?

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

Which versions are affected by CVE-2023-41330?

knplabs/knp-snappy < 1.4.3.

Is there a fix for CVE-2023-41330?

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

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

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.

Sponsors