Skip to content

← Public intelligence

Packagist package

pontedilana/php-weasyprint

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

4 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 6.5PackagistPublished

    PhpWeasyPrint vulnerable to SSRF and local file disclosure via the attachment option

    CVE-2026-49359 · GHSA-x8g9-h984-pc36

    Affected
    • Packagist pontedilana/php-weasyprint <= 2.5.1
    Fixed in
    2.6.0· Vendor fix available
    Issue
    pontedilana/php-weasyprint fetches the content of option values server-side via filegetcontents() when the value looks like a URL, without restricting the URL scheme. The attachment option of Pdf is the reachable sink: any value that passes isOptionUrl() (filtervar(..., FILTERVALIDATEURL)) is downloaded by the PHP process and embedded into the generated PDF. Because FILTERVALIDATEURL accepts http, https, ftp, file and PHP stream wrappers such as php://, an attacker who can influence the attachment value reaches both a Server-Side Request Forgery primitive (e.g. internal HTTP endpoints, cloud metadata) and a local file disclosure primitive (file://, php://filter/...), with the fetched bytes exfiltrated as a PDF attachment. This is the same class of issue KnpLabs/snappy patched for its xsl-style-sheet option in GHSA-c5fp-p67m-gq56. The library is documented as a one-to-one substitute for KnpLabs/snappy and shares the same code shape. Affected versions pontedilana/php-weasyprint…

    Recommended action: Upgrade to 2.6.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  2. Low, CVSS 3.0PackagistPublished

    PhpWeasyPrint vulnerable to arbitrary file deletion at shutdown via public $temporaryFiles

    CVE-2026-49358 · GHSA-5g9f-cwwg-4p8g

    Affected
    • Packagist pontedilana/php-weasyprint <= 2.5.1
    Fixed in
    2.6.0· Vendor fix available
    Issue
    AbstractGenerator::$temporaryFiles is a public array, and removeTemporaryFiles() — invoked from destruct() and from a registered shutdown function — calls unlink() on every entry without verifying that the path is contained within the temporary folder. Any code holding a reference to a generator instance can push an arbitrary path into the array and have it deleted on script shutdown. This mirrors the KnpLabs/snappy issue GHSA-87qc-37cw-84h4, patched in snappy 1.7.2. Affected versions pontedilana/php-weasyprint versions <= 2.5.1. Patched in: 2.6.0. Vulnerable code src/AbstractGenerator.php: No path-containment check: whatever path is present in $temporaryFiles at shutdown is unlinked. Proof of concept Impact - Arbitrary file deletion bound to script shutdown, scoped to the privileges of the PHP process user. - Not directly exploitable on its own (the attacker already needs to influence the property in the same request). The risk is amplification: chained with a separate…

    Recommended action: Upgrade to 2.6.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  3. High, CVSS 8.1PackagistPublished

    PhpWeasyPrint vulnerable to PHAR deserialization via output filename (CVE-2023-28115 case-insensitive bypass)

    CVE-2026-49286 · GHSA-2fmj-p74r-3wjm

    Affected
    • Packagist pontedilana/php-weasyprint <= 2.5.1
    Fixed in
    2.6.0· Vendor fix available
    Issue
    pontedilana/php-weasyprint guarded the output filename against the phar:// stream wrapper with a case-sensitive blacklist: PHP stream wrappers are case-insensitive, so PHAR://, Phar://, etc. bypass the check and reach fileExists() (fileexists()) in prepareOutput(). On PHP 7 (which the library still supports — PHP 7.4+), this triggers deserialization of a crafted PHAR archive's metadata, leading to remote code execution. This is the patch-bypass of CVE-2023-28115. The same issue and fix were handled upstream in KnpLabs/snappy (GHSA-92rv-4j2h-8mjj). Affected versions pontedilana/php-weasyprint versions <= 2.5.1 (the case-sensitive guard was introduced in commit eb8accc, "Implement countermeasures for CVE-2023-28115"). Patched in: 2.6.0. Privilege required A caller able to control the output filename passed to generate() / generateFromHtml(), plus the ability to place a PHAR archive on the filesystem (e.g. via an upload). Exploitation of the deserialization requires the server…

    Recommended action: Upgrade to 2.6.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  4. High, CVSS 8.2PackagistPublished

    php-weasyprint: shell command injection via configurable WeasyPrint binary path due to inverted is_executable() guard (mirror of KnpLabs/snappy GHSA-vpr4-p6fq-85jc)

    CVE-2026-49260 · GHSA-f5gc-qxf8-mh9g

    Affected
    • Packagist pontedilana/php-weasyprint <= 2.5.0
    Fixed in
    2.5.1· Vendor fix available
    Issue
    pontedilana/php-weasyprint builds the shell command for WeasyPrint by passing the binary path through escapeshellarg() first and then checking the quoted result with isexecutable(). On POSIX escapeshellarg('/usr/local/bin/weasyprint') returns '/usr/local/bin/weasyprint' with the single-quote characters as part of the string, so isexecutable() 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 (Snappy 1.7.1). Affected versions pontedilana/php-weasyprint versions <= 2.5.0…

    Recommended action: Upgrade to 2.5.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →