OS Command InjectionWeakness · CWE-78

CVE-2026-46643

HIGH · 7.5 CVSS v4.0 Published 2026-06-10
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
80/100
Remediation priority · High
No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Prior to version 1.7.1, 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. This issue has been patched in version 1.7.1.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Snappy PHP library before 1.7.1 has a command injection vulnerability where escapeshellarg() on POSIX incorrectly includes literal single-quote characters in the path, causing the is_executable() safety check to fail and allowing the binary path to be used unescaped. Since only the binary path is unescaped (not options/input/output), exploitation requires the binary path to be user-influenced through configuration, environment variables derived from request data, or concatenation with user-controlled fragments.

MitigationUpgrade Snappy to version 1.7.1 or later. Additionally, audit all code paths where the wkhtmltopdf binary path is specified to ensure it cannot be controlled or influenced by user input.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
Low
Privileges
None
Authentication
X
User interaction
None
Scope
X

CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify Snappy PHP library version
    Check your composer.json, composer.lock, or vendor directory for the installed snappy version. Run 'composer show knplabs/knp-snappy' if using Composer, or inspect the version string in the Snappy class file header.
    Affected if The installed version is before 1.7.1 (e.g., 1.7.0, 1.6.0, etc.)
  2. Locate binary path configuration
    Search your codebase for calls to setBinary or similar configuration methods for wkhtmltopdf/snappy. Look for where the path to the wkhtmltopdf binary is specified, often in config files, initialization code, or environment variables.
    Affected if A binary path is configured and the path value comes from a source that can be influenced by user input
  3. Audit binary path for user input inclusion
    Review how the binary path is constructed. Check if it includes concatenation with request data, environment variables that derive from request headers/parameters, or user-supplied configuration values. Search for patterns like $_GET, $_POST, $_REQUEST, or getenv() in the path construction.
    Affected if The binary path is built using any user-controlled or request-derived data, or set via environment variables that could be influenced by attackers
  4. Check for request-derived environment variables
    Inspect your application code for environment variable assignments that incorporate request data (e.g., putenv, $_ENV) which might later be used to determine the wkhtmltopdf binary path.
    Affected if Environment variables used to determine the binary path are set from request data or can be controlled by external input

You are affected if Snappy version is before 1.7.1 AND the wkhtmltopdf binary path can be influenced by user input through configuration, environment variables, or path concatenation with request-derived data.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade Snappy to version 1.7.1 or later. Additionally, audit all code paths where the wkhtmltopdf binary path is specified to ensure it cannot be controlled or influenced by user input.

Recommended fix High confidence

1.7.1

  1. Identify the Snappy PHP library dependency in your project (commonly via composer.json as 'knapsack/explode-php-snappy' or similar)
  2. Run 'composer show knapsack/explape-php-snappy --available' or check your composer.lock to confirm the currently installed version
  3. Run 'composer require knapsack/explode-php-snappy:1.7.1' to upgrade to the patched version
  4. Verify the upgrade completed successfully by running 'composer show knapsack/explode-php-snappy' and confirming version 1.7.1 or later
  5. Test that PDF/thumbnail generation functionality still works as expected
  6. If your application sources the wkhtmltopdf binary path from user-influenced configuration, ensure that path is validated or sanitized before use even in the patched version
Caveat Check release notes for 1.7.1 for any API changes; minor version upgrades typically have minimal breaking changes but test thoroughly

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation1.0 h
  • Testing2.0 h
  • Review / QA1.0 h
6.0 hours of engineering $1,060
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,696.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-46643 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-46643 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data