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

CVE-2026-46643: Snappy: Binary path is never shell-escaped due to an inverted is_executable check

May 21, 2026 (updated June 11, 2026)

On POSIX, escapeshellarg(‘/usr/bin/wkhtmltopdf’) returns the literal string ‘/usr/bin/wkhtmltopdf’ with the single-quote characters included. is_executable() then looks for a file whose actual name contains those quote characters, which essentially never exists. The safe branch is dead code and $command always falls through to the raw, unescaped value.

The rest of the arguments (options, input, output) are escaped correctly, so injection has to land in the binary string itself. That happens whenever the binary path is sourced from configuration that is user-influenced, derived from environment variables that ultimately come from request data, or concatenated with any user-controlled fragment.

References

  • github.com/KnpLabs/snappy/releases/tag/v1.7.1
  • github.com/KnpLabs/snappy/security/advisories/GHSA-vpr4-p6fq-85jc
  • github.com/advisories/GHSA-vpr4-p6fq-85jc
  • nvd.nist.gov/vuln/detail/CVE-2026-46643

Code Behaviors & Features

Detect and mitigate CVE-2026-46643 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 before 1.7.1

Fixed versions

  • 1.7.1

Solution

Upgrade to version 1.7.1 or above.

Impact 8.4 HIGH

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

Learn more about CVSS

Weakness

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

Source file

packagist/knplabs/knp-snappy/CVE-2026-46643.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Tue, 23 Jun 2026 12:24:58 +0000.