CVE-2026-49260: PhpWeasyPrint - Command Injection
- Cve: CVE-2026-49260
- Name: PhpWeasyPrint - Command Injection
- 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 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.
- Impact: Attackers can execute arbitrary shell commands remotely, potentially leading to full system compromise.
- Remediation: Update to version 2.5.1 or later.
- Vulnerability type: command_injection
- Vulnerability impact: remote_code_execution
- Requirements: Attacker must control the binary path configuration
- Labels source: projectdiscovery
- Severity: high
- Cvss score: 8.2
- Cvss vector: CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
- Epss score: 0.0021
- Epss percentile: 0.11209
- Assignee: [email protected]
- Published at: 2026-06-19T17:16:29Z
- Age in days: 158
- Modified at: 2026-10-25T23:10:00Z
- References total: 4
- Oss: yes
- Projects total: 2
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2026-49260
- Nvd status: deferred
- Checked, none or zero: patch available, known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, products total, products, rejected by nvd
- Not known: requirement type, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-78 | Improper Neutralization of Special Elements used in an OS Command |
References
Same in every row:
- Source: nvd
- Tags:
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| KnpLabs/snappy | security_advisory | yes | /v1/repositories/KnpLabs/snappy |
| pontedilana/php-weasyprint | commit, fix, package, releases, security_advisory | yes | /v1/repositories/pontedilana/php-weasyprint |
Index
- Checked, none or zero: repositories, repositories high signal, packages
Exploitation
- Authentication required: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports, exposed hosts