← Back to CVE Explorer

CVE-2026-49358

Full vulnerability record from the local CVENow database.

Description

PhpWeasyPrint is a PHP library allowing PDF generation from a URL or an HTML page. Prior to version 2.6.0, `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. PhpWeasyPrint version 2.6.0 contains a patch for the issue.

Severity
LOW
CVSS score
3.0 (v3.1)
Vulnerability status
Deferred
Source identifier
Published
2026-06-19 15:16:35.143000
Last modified
2026-10-25 23:10:00.167000
View original CVE JSON
{
  "id": "CVE-2026-49358",
  "sourceIdentifier": "[email protected]",
  "published": "2026-06-19T15:16:35.143",
  "lastModified": "2026-10-25T23:10:00.167",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "PhpWeasyPrint is a PHP library allowing PDF generation from a URL or an HTML page. Prior to version 2.6.0, `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. PhpWeasyPrint version 2.6.0 contains a patch for the issue."
    },
    {
      "lang": "es",
      "value": "PhpWeasyPrint es una biblioteca PHP que permite la generación de PDF a partir de una URL o una página HTML. Antes de la versión 2.6.0, ’AbstractGenerator::$temporaryFiles’ es un array público, y ’removeTemporaryFiles()’ - invocado desde ’__destruct()’ y desde una función de apagado registrada - llama a ’unlink()’ en cada entrada sin verificar que la ruta esté contenida dentro de la carpeta temporal. Cualquier código que mantenga una referencia a una instancia de generador puede insertar una ruta arbitraria en el array y hacer que se elimine al finalizar el script. Esto refleja el problema de KnpLabs/snappy GHSA-87qc-37cw-84h4. PhpWeasyPrint versión 2.6.0 contiene un parche para el problema."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "pontedilana",
          "product": "php-weasyprint",
          "versions": [
            {
              "version": "< 2.6.0",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L",
          "baseScore": 3.0,
          "baseSeverity": "LOW",
          "attackVector": "LOCAL",
          "attackComplexity": "HIGH",
          "privilegesRequired": "HIGH",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "NONE",
          "integrityImpact": "LOW",
          "availabilityImpact": "LOW"
        },
        "exploitabilityScore": 0.5,
        "impactScore": 2.5
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-06-23T02:08:49.575183Z",
          "id": "CVE-2026-49358",
          "options": [
            {
              "exploitation": "poc"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "partial"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-73"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/KnpLabs/snappy/security/advisories/GHSA-87qc-37cw-84h4",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1bff0c099c9391",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/pontedilana/php-weasyprint/releases/tag/2.6.0",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/pontedilana/php-weasyprint/security/advisories/GHSA-5g9f-cwwg-4p8g",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/pontedilana/php-weasyprint/security/advisories/GHSA-5g9f-cwwg-4p8g",
      "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"
    }
  ]
}