Impact
PhpWeasyPrint builds PDF generation commands by quoting the binary path and then incorrectly checking if the quoted string is executable. Because is_executable() looks for a file name that includes the surrounding quotes, the safe branch never fires. Consequently, the raw binary path supplied through configuration, environment, or per‑tenant settings is passed directly to the shell command, allowing an attacker to inject arbitrary commands into the process. This constitutes a shell command injection and the associated CWE-78.
Affected Systems
Installations of the pontedilana/php-weasyprint library that run versions older than 2.5.1 are affected. Any deployment that obtains the binary path from external configuration, environment variables, or per‑tenant settings is vulnerable. The 2.5.1 release contains the patch that removes the inverted guard and correctly validates the binary path.
Risk and Exploitability
The CVSS score of 8.2 indicates high severity with potential for remote code execution. The EPSS is not available, but the vulnerability remains exploitable via standard command‑injection techniques once the configuration is compromised. The library is not listed in the CISA KEV catalog, but the risk is significant for systems that expose the binary path to untrusted sources.
OpenCVE Enrichment