{"id":"CVE-2026-49260","published":"2026-06-19T16:59:01Z","modified":"2026-06-22T19:45:22Z","title":"PhpWeasyPrint: shell command injection via configurable WeasyPrint binary path due to inverted is_executable() guard…","vendor":"pontedilana","product":"php-weasyprint","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.2,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0021,"percentile":0.11465,"provenance":"source"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"}],"references":[{"url":"https://github.com/pontedilana/php-weasyprint/security/advisories/GHSA-f5gc-qxf8-mh9g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/KnpLabs/snappy/security/advisories/GHSA-vpr4-p6fq-85jc","tags":["x_refsource_MISC"]},{"url":"https://github.com/pontedilana/php-weasyprint/commit/9e86a2b317237fc5728f712f5037164530117f7e","tags":["x_refsource_MISC"]},{"url":"https://github.com/pontedilana/php-weasyprint/releases/tag/2.5.1","tags":["x_refsource_MISC"]}],"priority":{"score":8.0,"factors":[{"name":"EPSS percentile","points":2.29},{"name":"CVSS severity","points":5.74}]},"vendorSlug":"pontedilana","affectedVersions":[{"vendor":"pontedilana","product":"php-weasyprint","versions":["< 2.5.1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2026-06-22T19:45:10.727602Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"pontedilana/php-weasyprint","vulnerableRanges":["<2.5.1"],"patched":["2.5.1"],"from":["GHSA-f5gc-qxf8-mh9g"],"provenance":"source"}],"summary":{"text":"PhpWeasyPrint, a PHP library for generating PDFs from URLs or HTML, prior to version 2.5.1 has a shell command injection flaw: its check on the WeasyPrint binary path is applied to the escaped string rather than the raw path, so the check is ineffective and the unsanitised path is passed into a shell command. An attacker who can influence the binary path through configuration, an environment variable, or a per-tenant setting, and who has local access with high privileges, can execute arbitrary OS commands; no user interaction is required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:08:33Z"},"euvd":{"id":"EUVD-2026-38048","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-knplabs-snappy-cve-2023-28115","parents":[{"from":"CVE-2026-46643","to":"CVE-2026-49260","relation":"related","confidence":"high","kind":"lineage","evidence":[{"kind":"osv-related","provenance":"source","id":"GHSA-vpr4-p6fq-85jc","via":"related"},{"kind":"osv-related","provenance":"source","id":"GHSA-f5gc-qxf8-mh9g","via":"reference","url":"https://github.com/KnpLabs/snappy/security/advisories/GHSA-vpr4-p6fq-85jc"}]}],"children":[{"from":"CVE-2026-49260","to":"CVE-2026-49286","relation":"successor","confidence":"high","kind":"lineage","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:pontedilana/php-weasyprint","fromFixed":"2.5.1","toFixed":"2.6.0","daysApart":0},{"kind":"same-code","provenance":"machine","files":["src/AbstractGenerator.php"],"commits":["https://github.com/pontedilana/php-weasyprint/commit/9e86a2b317237fc5728f712f5037164530117f7e","https://github.com/pontedilana/php-weasyprint/commit/d1aa487722b5a3cab9b222b85fdb5608a5a550c3"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.33,"basis":"same product + description similarity"}]},{"from":"CVE-2026-49260","to":"CVE-2026-49358","relation":"successor","confidence":"high","kind":"lineage","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:pontedilana/php-weasyprint","fromFixed":"2.5.1","toFixed":"2.6.0","daysApart":0},{"kind":"same-code","provenance":"machine","files":["src/AbstractGenerator.php"],"commits":["https://github.com/pontedilana/php-weasyprint/commit/9e86a2b317237fc5728f712f5037164530117f7e","https://github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1bff0c099c9391"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.26,"basis":"same product + description similarity"}]},{"from":"CVE-2026-49260","to":"CVE-2026-49359","relation":"successor","confidence":"high","kind":"lineage","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:pontedilana/php-weasyprint","fromFixed":"2.5.1","toFixed":"2.6.0","daysApart":0},{"kind":"same-code","provenance":"machine","files":["src/Pdf.php"],"commits":["https://github.com/pontedilana/php-weasyprint/commit/9e86a2b317237fc5728f712f5037164530117f7e","https://github.com/pontedilana/php-weasyprint/commit/9582dcf119a405276cf55e9e10bc577a887792cb"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.37,"basis":"same product + description similarity"}]}],"packageHistory":[{"cve":"CVE-2026-49260","published":"2026-06-19","fixed":"2.5.1","kev":false},{"cve":"CVE-2026-49286","published":"2026-06-19","fixed":"2.6.0","kev":false},{"cve":"CVE-2026-49358","published":"2026-06-19","fixed":"2.6.0","kev":false},{"cve":"CVE-2026-49359","published":"2026-06-19","fixed":"2.6.0","kev":false}],"package":"Packagist:pontedilana/php-weasyprint"}}