# CVE-2026-49260: PhpWeasyPrint: shell command injection via configurable WeasyPrint binary path due to inverted is\_executable() guard (mirror of KnpLabs/snappy GHSA-vpr4-p6fq-85jc)

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.2
- **CVSS:** 8.2 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: High; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.22% (percentile 8, 2026-11-26)
- **CWE:** CWE-78
- **Aliases:** GHSA-f5gc-qxf8-mh9g
- **Published:** 2026-06-19T16:59:01.208Z
- **Modified:** 2026-10-25T23:10:00.167Z

## Who should check

- Projects that depend on Packagist package pontedilana/php-weasyprint (\< 2.5.1)
- Anyone running pontedilana php-weasyprint \< 2.5.1

## 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.

## Affected and fixed versions

- Packagist `pontedilana/php-weasyprint`: affected \< 2.5.1; fixed 2.5.1 (osv)
- pontedilana php-weasyprint: \< 2.5.1 (cvelist)

## Mitigation

- Upgrade pontedilana/php-weasyprint to 2.5.1 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-49260. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-49260.md
Affected: pontedilana/php-weasyprint < 2.5.1
Fixed in: 2.5.1

Steps:
1. Search this machine and project for pontedilana/php-weasyprint (Packagist), pontedilana php-weasyprint: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-49260 being exploited?

There is no confirmed exploitation: CVE-2026-49260 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.22% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-49260?

High: CVSS 8.2 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-49260?

pontedilana/php-weasyprint \< 2.5.1.

### Is there a fix for CVE-2026-49260?

Yes. Fixed in 2.5.1. Upgrade pontedilana/php-weasyprint to 2.5.1 or later.

### How do I check if I'm affected by CVE-2026-49260?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/pontedilana/php-weasyprint/security/advisories/GHSA-f5gc-qxf8-mh9g>
- vendor: <https://github.com/KnpLabs/snappy/security/advisories/GHSA-vpr4-p6fq-85jc>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-49260>
- patch: <https://github.com/pontedilana/php-weasyprint/commit/9e86a2b317237fc5728f712f5037164530117f7e>
- other: <https://github.com/pontedilana/php-weasyprint/releases/tag/2.5.1>
- other: <https://github.com/pontedilana/php-weasyprint>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-49260>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-f5gc-qxf8-mh9g> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2026-49260> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-49260>
