CVE-2026-106443
Description
A flaw was found in WeasyPrint. When processing documents with external image references, the image loading mechanism passes untrusted image data to the underlying image library without restricting unsafe formats such as Encapsulated PostScript (EPS). A remote attacker could provide a crafted document referencing malicious PostScript content to trigger Ghostscript interpretation. On systems with Ghostscript installed, this flaw can lead to arbitrary code execution.
Statement
An IMPORTANT severity flaw was found in WeasyPrint, a Python library for converting HTML and CSS documents to PDF that is shipped in Red Hat Ansible Automation Platform 2.5 via the automation-dashboard container image. When WeasyPrint renders documents with external image references (HTML img URLs, CSS image values, SVG image references, and data URIs), the image-loading path passes the fetched image bytes to Pillow's generic image dispatcher without excluding unsafe formats such as Encapsulated PostScript (EPS). On hosts with Ghostscript installed, Pillow's EpsImagePlugin invokes the Ghostscript interpreter for attacker-controlled PostScript, which can lead to arbitrary code execution when the installed Ghostscript version has a usable sandbox bypass; hosts without Ghostscript installed do not reach this rasterization path and are not vulnerable. Red Hat rates this flaw IMPORTANT with a CVSS 3.1 score of 8.1 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H), using a higher attack complexity than the upstream CVEORG score of 8.8 because exploitation requires Ghostscript to be installed on the host together with a usable Ghostscript sandbox bypass. The Red Hat Ansible Automation Platform affect is delegated to the responsible product team, which determined that the WeasyPrint version shipped in the automation-dashboard container already contains the upstream fix, so the vulnerable code is not present in the shipped product.
Mitigation
This flaw can be mitigated by removing Ghostscript from hosts where WeasyPrint renders untrusted documents: the vulnerable code path requires Pillow's EpsImagePlugin to invoke the Ghostscript interpreter, and hosts without Ghostscript installed never reach the PostScript rasterization path. Exposure can also be reduced by restricting WeasyPrint to render only trusted documents, or by blocking external image references (img URLs, CSS image values, SVG image references, and data URIs) from untrusted sources. For full remediation, upgrade to a version of WeasyPrint that contains the upstream fix.
Common Vulnerability Scoring System (CVSS) Score Details
Info alert:Important note
CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).
The following CVSS metrics and score provided are preliminary and subject to review.
CVSS v3 Score Breakdown
| Red Hat | NVD | cve.org | |
|---|---|---|---|
| Base Score | 8.1 | N/A | 8.8 |
| Attack Vector | Network | N/A | Network |
| Attack Complexity | High | N/A | Low |
| Privileges Required | None | N/A | Low |
| User Interaction | None | N/A | None |
| Scope | Unchanged | N/A | Unchanged |
| Confidentiality | High | N/A | High |
| Integrity Impact | High | N/A | High |
| Availability Impact | High | N/A | High |
Vector
Red Hat: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
cve.org: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Understanding the Weakness (CWE)
Access Control
Technical Impact: Bypass Protection Mechanism
In some cases, injectable code controls authentication; this may lead to a remote vulnerability.
Access Control
Technical Impact: Gain Privileges or Assume Identity
Injected code can access resources that the attacker is directly prevented from accessing.
Integrity,Confidentiality,Availability
Technical Impact: Execute Unauthorized Code or Commands
When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. As a result, code injection can often result in the execution of arbitrary code. Code injection attacks can also lead to loss of data integrity in nearly all cases, since the control-plane data injected is always incidental to data recall or writing.
Non-Repudiation
Technical Impact: Hide Activities
Often the actions performed by injected control code are unlogged.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.