CVE-2026-46643
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 · uneditedSnappy 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 confidenceSnappy 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.
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 checksWork through these to decide whether this CVE applies to you.
-
Identify Snappy PHP library versionCheck 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.)
-
Locate binary path configurationSearch 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
-
Audit binary path for user input inclusionReview 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
-
Check for request-derived environment variablesInspect 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.
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 · scopedUpgrade 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.
1.7.1
- Identify the Snappy PHP library dependency in your project (commonly via composer.json as 'knapsack/explode-php-snappy' or similar)
- Run 'composer show knapsack/explape-php-snappy --available' or check your composer.lock to confirm the currently installed version
- Run 'composer require knapsack/explode-php-snappy:1.7.1' to upgrade to the patched version
- Verify the upgrade completed successfully by running 'composer show knapsack/explode-php-snappy' and confirming version 1.7.1 or later
- Test that PDF/thumbnail generation functionality still works as expected
- 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
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation1.0 h
- Testing2.0 h
- Review / QA1.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-46643 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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