Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. knplabs/knp-snappy
  4. ›
  5. CVE-2023-28115

CVE-2023-28115: Deserialization of Untrusted Data

March 17, 2023

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.

References

  • github.com/KnpLabs/snappy/commit/1ee6360cbdbea5d09705909a150df7963a88efd6
  • github.com/KnpLabs/snappy/security/advisories/GHSA-gq6w-q6wh-jggc
  • github.com/advisories/GHSA-gq6w-q6wh-jggc
  • huntr.dev/bounties/0bdddc12-ff67-4815-ab9f-6011a974f48e/

Code Behaviors & Features

Detect and mitigate CVE-2023-28115 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 1.4.1

Fixed versions

  • 1.4.2

Solution

Upgrade to version 1.4.2 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-502: Deserialization of Untrusted Data
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Source file

packagist/knplabs/knp-snappy/CVE-2023-28115.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:38 +0000.