Skip to main content

WeasyPrint CVE-2026-106443

| EUVDEUVD-2026-93668 HIGH
Improper Input Validation (CWE-20)
2026-10-06 security-advisories@github.com GHSA-r543-q48m-4c9j
8.8
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit untrusted HTML to PDF renderer
  2. Delivery
    Embed malicious EPS via img/CSS/SVG/data-URI
  3. Exploit
    Pillow dispatches bytes to EpsImagePlugin
  4. Execution
    Ghostscript interprets attacker PostScript
  5. Impact
    Write files or execute code on host

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Requires WeasyPrint prior to 70.0 rendering attacker-controlled content (HTML img URLs, CSS image values, SVG image references, or data URIs) AND Ghostscript installed on the host - hosts without Ghostscript never reach the EPS rasterization path. With any Ghostscript present, attacker PostScript gains interpreter-permitted effects such as arbitrary file writes (demonstrated by the fix commit's dangerous.eps writing /tmp/test-marker.txt). Full remote code execution additionally requires the installed Ghostscript to have a usable sandbox (-dSAFER) bypass. Limiting factors: no user interaction needed, but exploitation is blocked entirely on hosts lacking Ghostscript, requires the application to pass untrusted image/URL content into WeasyPrint, and escalation from file-write to code execution is contingent on a bypassable Ghostscript version.

Impact

Signals mostly align toward a genuine priority but with important conditionality. The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/C:H/I:H/A:H, 8.8 High) frames this as a network-reachable, low-complexity, low-privilege path to full confidentiality/integrity/availability loss. No EPSS score, CISA KEV entry, or standalone exploit flag was supplied, so widespread or confirmed active exploitation is NOT established - exploitation status is 'no public exploit identified at time of analysis' in the formal sense. However, the fix commit's test resources include a functional malicious PostScript payload (dangerous.eps) that writes a marker file, which is effectively public proof-of-concept material demonstrating the interpreter abuse. The headline risk (full RCE) is explicitly conditional: the description states it 'can lead to remote code execution when the installed Ghostscript version has a usable sandbox bypass,' and 'Hosts without Ghostscript do not reach this rasterization path.' So the real-world footprint is gated by (a) Ghostscript being installed and (b) that Ghostscript being bypassable. Conflict to flag: the CVSS AC:L understates the environmental dependency on Ghostscript presence and a usable sandbox bypass for the RCE outcome - I assess AC:H for the code-execution impact. Also, NVD uses PR:L (authenticated), but the vulnerability is triggered purely by attacker-controlled rendered content, which in many document-generation deployments requires no authentication to the library itself - verify the privilege assumption against your specific deployment. Net: treat as high priority for any WeasyPrint <70.0 service that (1) renders untrusted HTML/CSS/SVG and (2) has Ghostscript installed; lower priority where Ghostscript is absent.

Exploit ScenarioDerived

An attacker submits HTML to a WeasyPrint-backed PDF generation service containing an image reference (img src, CSS image value, SVG image, or data URI) that points to a malicious EPS/PostScript file. On a host with Ghostscript installed, Pillow's EpsImagePlugin invokes the Ghostscript interpreter on the attacker's PostScript, enabling interpreter-permitted effects such as arbitrary file writes and, where the Ghostscript version has a usable sandbox bypass, remote code execution. A working proof-of-concept EPS payload that writes a marker file is included in the vendor fix commit's test resources (tests/resources/dangerous.eps).

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.7% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 06, 2026

WeasyPrint releases prior to 70.0 hand attacker-controlled bytes - from HTML img URLs, CSS image values, SVG image references, and data URIs - to Pillow's generic image dispatcher, which does not exclude Encapsulated PostScript, so on any host with Ghostscript installed Pillow's EpsImagePlugin shells out to that interpreter and runs the attacker's PostScript. This produces interpreter-permitted effects, demonstrated by the fix commit's dangerous.eps sample writing /tmp/test-marker.txt, and escalates to remote code execution when the installed Ghostscript has a usable -dSAFER sandbox bypass; hosts without Ghostscript never reach the rasterization path and are not exploitable. No public exploit code and no CISA KEV entry were identified at time of analysis, and the vendor-released patch is WeasyPrint 70.0; the published CVSS is 8.8 while our own assessment rates attack complexity as High with no privileges and no user interaction required.

RemediationAI

Upgrade WeasyPrint to version 70.0, which fixes the issue by setting EpsImagePlugin.gs_binary = False so Ghostscript is never invoked for EPS handling and by converting rasterization failures into a clean ImageLoadingError; release notes are at https://github.com/Kozea/WeasyPrint/releases/tag/v70.0, the code change at https://github.com/Kozea/WeasyPrint/commit/39cd37ce1610bd890388e26591c569db1cbab542, and the advisory at https://github.com/Kozea/WeasyPrint/security/advisories/GHSA-r543-q48m-4c9j. If immediate upgrade is not possible, remove Ghostscript from the render host or from the WeasyPrint process PATH so the EpsImagePlugin cannot spawn it - this eliminates the vulnerability path entirely at the cost of losing legitimate EPS rendering (an acceptable trade-off for most PDF-generation services), and containerizing the renderer without gs achieves the same effect. Additionally, validate and filter inputs so untrusted content cannot inject image URLs: reject or strip content whose bytes begin with %!PS, whose declared type is application/postscript or image/x-eps, and consider blocking remote image fetching and data: URIs for untrusted documents, though this last step may break legitimate embedded-image features and requires testing against real templates. Running WeasyPrint as an unprivileged user in a sandboxed environment limits the impact of the interpreter-permitted side effects (such as arbitrary file writes) if a bypass is still reachable.

Affected VersionsENISA

WeasyPrint < 70.0

Affected Packages

pypi weasyprint fix: 70.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The root cause is CWE-20 improper input validation in WeasyPrint's image pipeline: get_image_from_uri in weasyprint/images.py fetches image bytes and passes them to Pillow's generic Image.open dispatcher without screening out EPS/PostScript formats, so an EPS payload with the %!PS-Adobe header is routed to Pillow's EpsImagePlugin. That plugin is not a pure-Python rasterizer - it invokes the external Ghostscript interpreter (configured via EpsImagePlugin.gs_binary) to convert the file, meaning attacker-controlled PostScript is executed by gs under whatever privileges the WeasyPrint process holds. Multiple ingestion vectors all converge on the same sink: HTML img src attributes, CSS image values, SVG image references, and data: URIs. The upstream fix in commit 39cd37ce1610bd890388e26591c569db1cbab542 imports EpsImagePlugin and sets EpsImagePlugin.gs_binary = False to prevent Ghostscript from ever being spawned for EPS rendering, and additionally wraps the RasterImage construction in a try/except that converts rasterization failures into an ImageLoadingError so malformed or refused images degrade cleanly; a regression test (test_images_refused) and the tests/resources/dangerous.eps proof-of-concept file accompany the change. No CPE strings were supplied in the source data, so affected products are identified by package name and version range rather than CPE; the advisory is tagged RCE.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 8.8 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 8.1 HIGH

Attacker-supplied rendered content needs no authentication (PR:N); full RCE depends on Ghostscript being installed with a usable sandbox bypass, an attacker-uncontrolled condition (AC:H), yielding full C/I/A impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Red Hat 8.1 HIGH

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Oct 06, 2026 - 20:04 EUVD
CVE Published
Oct 06, 2026 - 19:18 cve.org
HIGH 8.8

DescriptionCVE.org

WeasyPrint helps web developers to create PDF documents. Prior to 70.0, the image-loading path in weasyprint/images.py passes fetched image bytes from HTML img URLs, CSS image values, SVG image references, and data URIs to Pillow's generic image dispatcher without excluding EPS or PostScript formats. On hosts with Ghostscript installed, Pillow EpsImagePlugin invokes the interpreter for attacker-controlled PostScript, which can produce interpreter-permitted effects and can lead to remote code execution when the installed Ghostscript version has a usable sandbox bypass. Hosts without Ghostscript do not reach this rasterization path. This issue is fixed in version 70.0.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 545 pypi packages depend on weasyprint (412 direct, 138 indirect)

Ecosystem-wide dependent count for version 70.0.

Technical POC Analysis

CWE-20 (Improper Input Validation): WeasyPrint does not validate the format of image bytes before handing them to a format-agnostic parser.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

WeasyPrint versions prior to 70.0 can expose organizations to potential code execution on hosts that also run Ghostscript, affecting document generation and reporting services that process untrusted HTML or CSS. No public exploit was identified at time of analysis, and the vendor has released WeasyPrint 70.0, so the primary business risk is unpatched instances in environments where Ghostscript is present. Leadership should prioritize patching because a successful compromise could allow an attacker to run commands on the affected server.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.7%
Top 49% exploitable
Prevalence
Medium
popular Python PDF library, but impact gated by co-installed Ghostscript
Threat Intel
1
1 sources
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.7%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy