Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.2%top 87%

CVE-2026-49260: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pontedilana php-weasyprint

0
High
VulnerabilityCVE-2026-49260cvecve-2026-49260cwe-78
Published: 06/19/2026 (06/19/2026, 16:59:01 UTC)
Source: CVE Database V5
Vendor/Project: pontedilana
Product: php-weasyprint

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.

CVSS v3.1

Score 8.2high

Attack Vector
Local
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

Affected software

Packagistmore threats →ai
pontedilana/php-weasyprint
pkg:composer/pontedilana/php-weasyprint
Affected versions
<2.5.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 06/26/2026, 19:15:37 UTC

Technical Analysis

CVE-2026-49260 is an OS command injection vulnerability in pontedilana/php-weasyprint versions prior to 2.5.1. The library attempts to sanitize the WeasyPrint binary path by using escapeshellarg() and then verifying its executability with is_executable(). However, escapeshellarg() adds single quotes around the path, causing is_executable() to check a non-existent file with quotes in its name. This results in the safe code path never executing, and the raw binary path string is passed directly to Symfony\Component\Process\Process::fromShellCommandline(), which executes it in a shell context. If the binary path is sourced from configuration, environment variables, or tenant-specific settings, this leads to a shell command injection vulnerability. The issue was patched in version 2.5.1.

Potential Impact

An attacker with high privileges who can influence the binary path configuration can execute arbitrary shell commands on the host system. This can lead to complete compromise of confidentiality, integrity, and availability of the affected system. The vulnerability has a CVSS 3.1 score of 8.2 (high severity), reflecting its potential for significant impact. There are no known exploits in the wild at this time.

Mitigation Recommendations

Upgrade to php-weasyprint version 2.5.1 or later, which contains a patch for this vulnerability. Until upgraded, ensure that the binary path configuration cannot be influenced by untrusted sources. Patch status is not explicitly stated as 'official-fix' but the vendor has released version 2.5.1 containing the fix, so upgrading is the recommended remediation.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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: 06/19/2026, 17:05:18 UTC

Last enriched: 06/26/2026, 19:15:37 UTC

Last updated: 08/01/2026, 19:18:00 UTC

Views: 61

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses