Command Injection Affecting pontedilana/php-weasyprint package, versions <2.5.1


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.23% (14th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-PONTEDILANAPHPWEASYPRINT-17420048
  • published23 Jun 2026
  • disclosed19 Jun 2026
  • credittonghuaroot

Introduced: 19 Jun 2026

CVE-2026-49260  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade pontedilana/php-weasyprint to version 2.5.1 or higher.

Overview

pontedilana/php-weasyprint is a PHP library allowing PDF generation from an url or a html page.

Affected versions of this package are vulnerable to Command Injection in the binary-path validation in src/AbstractGenerator.php, where is_executable() is tested against the escapeshellarg()-quoted path rather than the raw one. A user who can control the binary path passed to the Pdf constructor or AbstractGenerator::setBinary() can execute arbitrary commands as the PHP process user by embedding shell metacharacters in that value. Exploitation requires influence over the binary path, via configuration, environment variables, an admin UI, or per-tenant settings. And the injected commands run with the privileges of the PHP process.

CVSS Base Scores

version 4.0
version 3.1