CVE-2026-49260: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pontedilana php-weasyprint
PhpWeasyPrint, a PHP library for PDF generation, contains an OS command injection vulnerability in versions prior to 2.5.1. The issue arises because the binary path is improperly validated, allowing crafted input to reach a shell command execution function without proper sanitization. This vulnerability has a high severity with a CVSS score of 8.2. Version 2.5.1 includes a patch that fixes this problem.
AI Analysis
Technical Summary
PhpWeasyPrint versions before 2.5.1 improperly neutralize special elements in the OS command used to invoke the WeasyPrint binary. The library attempts to validate the binary path by quoting it with escapeshellarg() and then checking its executability with is_executable(), but this check fails because the quotes become part of the filename. Consequently, the validation is bypassed, and the raw binary path string, which may come from configuration or environment variables, is passed directly to Symfony's Process::fromShellCommandline(), enabling OS command injection. The vulnerability is fixed in version 2.5.1.
Potential Impact
Successful exploitation allows an attacker with high privileges (local access with high privileges) to execute arbitrary OS commands with the privileges of the php-weasyprint process. This can lead to complete system compromise, including confidentiality, integrity, and availability impacts. The vulnerability requires local access and high privileges but does not require user interaction.
Mitigation Recommendations
A fix is available in php-weasyprint version 2.5.1. Users should upgrade to version 2.5.1 or later to remediate this vulnerability. Until upgraded, avoid sourcing the binary path from untrusted configuration or environment variables to reduce risk.
CVE-2026-49260: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pontedilana php-weasyprint
Description
PhpWeasyPrint, a PHP library for PDF generation, contains an OS command injection vulnerability in versions prior to 2.5.1. The issue arises because the binary path is improperly validated, allowing crafted input to reach a shell command execution function without proper sanitization. This vulnerability has a high severity with a CVSS score of 8.2. Version 2.5.1 includes a patch that fixes this problem.
CVSS v3.1
Score 8.2high
Affected software
pkg:composer/pontedilana/php-weasyprintRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
PhpWeasyPrint versions before 2.5.1 improperly neutralize special elements in the OS command used to invoke the WeasyPrint binary. The library attempts to validate the binary path by quoting it with escapeshellarg() and then checking its executability with is_executable(), but this check fails because the quotes become part of the filename. Consequently, the validation is bypassed, and the raw binary path string, which may come from configuration or environment variables, is passed directly to Symfony's Process::fromShellCommandline(), enabling OS command injection. The vulnerability is fixed in version 2.5.1.
Potential Impact
Successful exploitation allows an attacker with high privileges (local access with high privileges) to execute arbitrary OS commands with the privileges of the php-weasyprint process. This can lead to complete system compromise, including confidentiality, integrity, and availability impacts. The vulnerability requires local access and high privileges but does not require user interaction.
Mitigation Recommendations
A fix is available in php-weasyprint version 2.5.1. Users should upgrade to version 2.5.1 or later to remediate this vulnerability. Until upgraded, avoid sourcing the binary path from untrusted configuration or environment variables to reduce risk.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-28T14:33:01.179Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a3576cef198dc38c1c38eaf
Added to database: 6/19/2026, 5:05:18 PM
Last enriched: 6/19/2026, 5:20:24 PM
Last updated: 6/19/2026, 6:15:18 PM
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.