{"answers":{"affected":"3 open source packages ship an affected version, including weasyprint.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-49452 exists.","fix":"Upgrade to a fixed version.","what":"CVE-2026-49452 is a medium-severity code injection vulnerability in Kozea WeasyPrint, published on 18 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-49452 and fix it if it is affected.\n\nWhat it is: CVE-2026-49452 is a medium-severity code injection vulnerability in Kozea WeasyPrint, published on 18 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-49452 exists.\n\nAffected packages and fixed versions:\n- weasyprint (PyPI): affected all versions up to 68.1; no fix listed\n- weasyprint (PyPI): affected all versions up to 68.1; no fix listed\n- weasyprint (PyPI): affected all versions up to 68.1; no fix listed\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-49452/ (Markdown: https://insights.sbomify.com/CVE-2026-49452/index.md)","id":"CVE-2026-49452","markdown":"https://insights.sbomify.com/CVE-2026-49452/index.md","name":"CVE-2026-49452","record":{"aliases":["DEBIAN-CVE-2026-49452","GHSA-jhhc-3hcp-qhm5","PYSEC-2026-3412","UBUNTU-CVE-2026-49452","openSUSE-SU-2026:11249-1","openSUSE-SU-2026:21364-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","data_read"],"network_reachable":"yes","non_default_config":true,"product_category":"Python PDF library","requires_auth":"none","summary":"Attackers can inject CSS via unescaped HTML attributes in WeasyPrint when presentational hints are enabled, potentially triggering server-side requests or code execution.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":6.5,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"description":"WeasyPrint helps web developers to create PDF documents. Prior to 69.0, WeasyPrint embeds unescaped HTML presentational-hint attribute values into CSS in weasyprint/css/__init__.py when presentational_hints=True. The background attribute is inserted into a background-image:url() declaration and parsed by tinycss2.parse_blocks_contents(), allowing untrusted HTML to inject additional CSS declarations. Applications that render untrusted HTML with presentational hints enabled can be affected by CSS injection and server-side requests through injected url() values. This issue is fixed in version 69.0.","ecosystems":["PyPI","openSUSE:Leap 16.0","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"WeasyPrint: CSS Injection via Presentational Hints","id":"CVE-2026-49452","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2026"},"n_packages":5,"n_references":4,"next":{"headline":"Joplin: Path traversal in resource sync — silent arbitrary file write outside the resource directory","id":"CVE-2026-49453"},"packages":[{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["68.1"],"package":"weasyprint","purl":null,"source":"GHSA-jhhc-3hcp-qhm5"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["68.1"],"package":"weasyprint","purl":"pkg:pypi/weasyprint","source":"GHSA-jhhc-3hcp-qhm5"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["68.1"],"package":"weasyprint","purl":"pkg:pypi/weasyprint","source":"PYSEC-2026-3412"},{"ecosystem":"openSUSE:Leap 16.0","fixed":["65.1-bp160.3.1"],"introduced":["0"],"last_affected":[],"package":"python-weasyprint","purl":"pkg:rpm/opensuse/python-weasyprint\u0026distro=openSUSE%20Leap%2016.0","source":"openSUSE-SU-2026:21364-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["69.0-1.1"],"introduced":["0"],"last_affected":[],"package":"python-weasyprint","purl":"pkg:rpm/opensuse/python-weasyprint\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2026:11249-1"}],"prev":{"headline":"Microsoft.OpenAPI: Circular schema references may terminate OpenAPI parsing","id":"CVE-2026-49451"},"products":["WeasyPrint"],"published":"2026-08-18","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":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-08-19","vendors":["Kozea"]},"summary":"Attackers can inject CSS via unescaped HTML attributes in WeasyPrint when presentational hints are enabled, potentially triggering server-side requests or code execution.","url":"https://insights.sbomify.com/CVE-2026-49452/"}