Skip to content
Heist/ feed
Back to feed
High

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

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-46643
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 00:46 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 10 Jun 2026, 19:52 UTC

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.

osv:CVE-2026-46643
Complete source record
{
  "id": "db5af84c93627d8d49687e6a7fde335d5f71b830574567026e8dca9d37ec8f80",
  "url": "https://osv.dev/vulnerability/CVE-2026-46643",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Snappy: Binary path is never shell-escaped due to an inverted is_executable check",
    "summary": "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.",
    "evidence": "osv:CVE-2026-46643",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-46643",
      "aliases": [
        "CVE-2026-46643",
        "GHSA-vpr4-p6fq-85jc"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/knplabs/snappy",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "b8c7480fdd279d9824de1b3041eda1ade37aa1a5"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.7.1"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "b8c7480fdd279d9824de1b3041eda1ade37aa1a5"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v1.7.1"
                  },
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.7.1"
                      }
                    ],
                    "source": "DESCRIPTION"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.7.0",
            "v1.6.0",
            "v1.5.1",
            "v1.5.0",
            "v1.4.4",
            "v1.4.3",
            "v1.4.2",
            "v1.4.1",
            "v1.4.0",
            "v1.3.1",
            "v1.3.0",
            "v1.2.1",
            "v1.2.0",
            "v1.1.0",
            "v1.0.4",
            "v1.0.3",
            "v1.0.2",
            "v1.0.1",
            "v1.0",
            "v0.5.0",
            "0.4.3",
            "0.4.2",
            "0.4.1",
            "0.4",
            "0.3.4",
            "0.3.3",
            "0.3.2",
            "0.3.1",
            "0.3.0",
            "0.2.1",
            "0.2.0",
            "0.1.2",
            "0.1.1",
            "0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-46643.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:48.432085034Z",
      "provider": "osv",
      "references": [
        "https://github.com/KnpLabs/snappy/releases/tag/v1.7.1",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46643.json",
        "https://github.com/KnpLabs/snappy/security/advisories/GHSA-vpr4-p6fq-85jc",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-46643"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-78"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46643.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-46643",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 516726,
  "published_at": "2026-06-10T19:52:59.944+00:00"
}