{"answers":{"affected":"2 open source packages ship an affected version, including pontedilana/php-weasyprint.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-49358 exists.","fix":"Upgrade pontedilana/php-weasyprint to 2.6.0 or later.","what":"CVE-2026-49358 is a low-severity path traversal vulnerability in pontedilana php-weasyprint, published on 19 Jun 2026. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-49358 and fix it if it is affected.\n\nWhat it is: CVE-2026-49358 is a low-severity path traversal vulnerability in pontedilana php-weasyprint, published on 19 Jun 2026. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-49358 exists.\n\nAffected packages and fixed versions:\n- pontedilana/php-weasyprint (Packagist): affected all versions; fixed in 2.6.0\n- pontedilana/php-weasyprint (Packagist): affected all versions; fixed in 2.6.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-49358/ (Markdown: https://insights.sbomify.com/CVE-2026-49358/index.md)","id":"CVE-2026-49358","markdown":"https://insights.sbomify.com/CVE-2026-49358/index.md","name":"CVE-2026-49358","record":{"aliases":["GHSA-5g9f-cwwg-4p8g"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_modify"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"PHP PDF generation library","requires_auth":"high_privilege","summary":"Attackers can delete arbitrary files by injecting paths into a public array, affecting applications using PhpWeasyPrint for PDF generation.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":3,"severity":"low","source":"cna","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L","version":"3.1"},"cwes":[{"id":"CWE-73","name":"External Control of File Name or Path"}],"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.","ecosystems":["Packagist"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"PhpWeasyPrint vulnerable to arbitrary file deletion at shutdown via public $temporaryFiles","id":"CVE-2026-49358","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"path_traversal","year":"2026"},"n_packages":2,"n_references":4,"next":{"headline":"PhpWeasyPrint vulnerable to SSRF and local file disclosure via the attachment option","id":"CVE-2026-49359"},"packages":[{"ecosystem":"Packagist","fixed":["2.6.0"],"introduced":["0"],"last_affected":[],"package":"pontedilana/php-weasyprint","purl":null,"source":"GHSA-5g9f-cwwg-4p8g"},{"ecosystem":"Packagist","fixed":["2.6.0"],"introduced":["0"],"last_affected":[],"package":"pontedilana/php-weasyprint","purl":"pkg:composer/pontedilana/php-weasyprint","source":"GHSA-5g9f-cwwg-4p8g"}],"prev":{"headline":"Streamable HTTP mode exposes LINE Desktop read/send tools without MCP authentication","id":"CVE-2026-49357"},"products":["php-weasyprint"],"published":"2026-06-19","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-06-23","vendors":["pontedilana"]},"summary":"Attackers can delete arbitrary files by injecting paths into a public array, affecting applications using PhpWeasyPrint for PDF generation.","url":"https://insights.sbomify.com/CVE-2026-49358/"}