External Control of File Name or Path Affecting pontedilana/php-weasyprint package, versions <2.6.0


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.15% (5th 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 IDSNYK-PHP-PONTEDILANAPHPWEASYPRINT-17406212
  • published7 Jul 2026
  • disclosed19 Jun 2026
  • creditUnknown

Introduced: 19 Jun 2026

CVE-2026-49358  (opens in a new tab)
CWE-73  (opens in a new tab)

How to fix?

Upgrade pontedilana/php-weasyprint to version 2.6.0 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 External Control of File Name or Path via the temporaryFiles array accessed by AbstractGenerator.php, which is publicly accessible. An attacker can cause arbitrary files to be deleted by injecting file paths into this array, which are then unconditionally unlinked during shutdown.

PoC

<?php
use Pontedilana\PhpWeasyPrint\Pdf;

$pdf = new Pdf();
$pdf->temporaryFiles[] = '/var/www/html/.env';

CVSS Base Scores

version 4.0
version 3.1