{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-49260","id":"CVE-2026-49260","title":"PhpWeasyPrint: shell command injection via configurable WeasyPrint binary path due to inverted is_executable() guard (mirror of KnpLabs/snappy GHSA-vpr4-p6fq-85jc)","description":"PhpWeasyPrint is a PHP library allowing PDF generation from a URL or an HTML page. Prior to version 2.5.1, `pontedilana/php-weasyprint` builds the shell command for WeasyPrint by passing the binary path through `escapeshellarg()` first and then checking the *quoted* result with `is_executable()`. On POSIX `escapeshellarg('/usr/local/bin/weasyprint')` returns `'/usr/local/bin/weasyprint'` with the ","descriptionLong":"PhpWeasyPrint is a PHP library allowing PDF generation from a URL or an HTML page. Prior to version 2.5.1, `pontedilana/php-weasyprint` builds the shell command for WeasyPrint by passing the binary path through `escapeshellarg()` first and then checking the *quoted* result with `is_executable()`. On POSIX `escapeshellarg('/usr/local/bin/weasyprint')` returns `'/usr/local/bin/weasyprint'` with the single-quote characters as part of the string, so `is_executable()` looks for a file whose actual name includes those quotes. That file never exists, the \"safe\" branch is dead code, and the raw `$binary` string (set via the constructor or `setBinary()`) flows directly into `Symfony\\Component\\Process\\Process::fromShellCommandline()`. Any deployment whose binary path is sourced from configuration, an environment variable, or a per-tenant setting reaches a shell-command-injection sink. The library is documented as a one-to-one substitute for KnpLabs/snappy and inherited the exact pre-fix codepath KnpLabs patched in GHSA-vpr4-p6fq-85jc. PhpWeasyPrint version 2.5.1 contains a patch for the issue.","published":"2026-06-19T16:59:01.208Z","updated":"2026-10-28T02:31:04.200266676Z","reserved":"2026-05-28T14:33:01.179Z","status":"Deferred","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":8.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","rating":"high","source":"GitHub_M"},"metrics":[{"version":"3.1","score":8.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","rating":"high","source":"GitHub_M"},{"version":"3.1","score":8.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","rating":"high","source":"github.com"},{"version":"3.1","score":8.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","rating":"high","source":"OSV"},{"version":"3.1","score":8.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","rating":"high","source":"GitHub"}],"rating":"high","products":["pontedilana php-weasyprint"],"affectedProducts":[{"vendor":"pontedilana","product":"php-weasyprint","defaultStatus":null,"versions":[{"version":"< 2.5.1","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"Packagist","name":"pontedilana/php-weasyprint","purl":"pkg:composer/pontedilana/php-weasyprint","ranges":["<2.5.1"],"fixed":["2.5.1"],"advisory":"GHSA-f5gc-qxf8-mh9g"}],"cwes":["CWE-78"],"aliases":["GHSA-f5gc-qxf8-mh9g"],"references":[{"url":"https://github.com/pontedilana/php-weasyprint/security/advisories/GHSA-f5gc-qxf8-mh9g","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/KnpLabs/snappy/security/advisories/GHSA-vpr4-p6fq-85jc","tags":["x_refsource_MISC","exploit","advisory","web"]},{"url":"https://github.com/pontedilana/php-weasyprint/commit/9e86a2b317237fc5728f712f5037164530117f7e","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/pontedilana/php-weasyprint/releases/tag/2.5.1","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/49xxx/CVE-2026-49260.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49260","tags":["advisory"]},{"url":"https://github.com/pontedilana/php-weasyprint","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total"},"epss":0.0021,"epssPercentile":0.11365,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-49260","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49260","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-49260","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-f5gc-qxf8-mh9g","ok":true,"note":"GHSA-f5gc-qxf8-mh9g"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-49260","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}