CVE-2026-49452
WeasyPrint: CSS Injection via Presentational Hints
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
6.5
WeasyPrint: CSS Injection via Presentational Hints
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.
- Record
CVE-2026-49452- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-74
- Updated
- 2026-11-02
EUVDEUVD-2026-61143
6.5
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.
- Record
EUVD-2026-61143- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-jhhc-3hcp-qhm5
6.5
WeasyPrint has CSS Injection via Presentational Hints
Summary
A CSS injection issue exists in WeasyPrint when HTML presentational hints are enabled. Unescaped attribute values are embedded into CSS, allowing injection of arbitrary CSS declarations. This affects applications processing untrusted HTML input.
Details
File: weasyprint/css/init.py
The background attribute is used to construct CSS:
background-image:url({element.get("background")})
This string is parsed by tinycss2.parse_blocks_contents().
Because the value is not escaped, additional CSS declarations can be injected.
PoC
<body background="x);background-image:url(http://169.254.169.254/latest/meta-data/)">
Impact
- CSS injection
- Server-side requests via injected
url() - Limited to cases where
presentational_hints=True
Suggested Fix
- Escape attribute values before embedding into CSS
- Restrict allowed values for presentational hints VULN-05_css_injection_presentational_hints.md
- Record
GHSA-jhhc-3hcp-qhm5- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-74
- Updated
- 2026-11-02
NVD
6.5
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.
- Record
CVE-2026-49452- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-74
- Updated
- 2026-11-02
OSV
6.5
WeasyPrint: CSS Injection via Presentational Hints
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.
- Record
CVE-2026-49452- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-74
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-49452
6.5
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.
- Record
DEBIAN-CVE-2026-49452- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
Show 5 moreShow less
OSVGHSA-jhhc-3hcp-qhm5
6.5
WeasyPrint has CSS Injection via Presentational Hints
Summary
A CSS injection issue exists in WeasyPrint when HTML presentational hints are enabled. Unescaped attribute values are embedded into CSS, allowing injection of arbitrary CSS declarations. This affects applications processing untrusted HTML input.
Details
File: weasyprint/css/init.py
The background attribute is used to construct CSS:
background-image:url({element.get("background")})
This string is parsed by tinycss2.parse_blocks_contents().
Because the value is not escaped, additional CSS declarations can be injected.
PoC
<body background="x);background-image:url(http://169.254.169.254/latest/meta-data/)">
Impact
- CSS injection
- Server-side requests via injected
url() - Limited to cases where
presentational_hints=True
Suggested Fix
- Escape attribute values before embedding into CSS
- Restrict allowed values for presentational hints VULN-05_css_injection_presentational_hints.md
- Record
GHSA-jhhc-3hcp-qhm5- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-74
- Updated
- 2026-11-02
OSVPYSEC-2026-3412
6.5
WeasyPrint has CSS Injection via Presentational Hints
Summary
A CSS injection issue exists in WeasyPrint when HTML presentational hints are enabled. Unescaped attribute values are embedded into CSS, allowing injection of arbitrary CSS declarations. This affects applications processing untrusted HTML input.
Details
File: weasyprint/css/init.py
The background attribute is used to construct CSS:
background-image:url({element.get("background")})
This string is parsed by tinycss2.parse_blocks_contents().
Because the value is not escaped, additional CSS declarations can be injected.
PoC
<body background="x);background-image:url(http://169.254.169.254/latest/meta-data/)">
Impact
- CSS injection
- Server-side requests via injected
url() - Limited to cases where
presentational_hints=True
Suggested Fix
- Escape attribute values before embedding into CSS
- Restrict allowed values for presentational hints VULN-05_css_injection_presentational_hints.md
- Record
PYSEC-2026-3412- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-49452
6.5
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.
- Record
UBUNTU-CVE-2026-49452- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11249-1 No score
python313-weasyprint-69.0-1.1 on GA media
These are all security issues fixed in the python313-weasyprint-69.0-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11249-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:21364-1 No score
Security update for python-weasyprint
This update for python-weasyprint fixes the following issues:
Changes in python-weasyprint:
- CVE-2026-49452: CSS Injection via Presentational Hints (bsc#1270401)
- Record
openSUSE-SU-2026:21364-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
weasyprintPyPI |
through 68.1 | None known |
weasyprintDebian:12 |
All versions, plus listed versions 57.2-159.0-160.2-161.0-161.1-1 Show 10 moreShow less61.2-161.2-262.0-162.1-162.2-162.3-167.0-169.0-169.0-270.0-1 |
None known |
weasyprintDebian:13 |
All versions, plus listed versions 62.3-167.0-169.0-169.0-270.0-1 |
None known |
weasyprintDebian:14 |
before 69.0-1, plus listed versions 62.3-167.0-1 |
69.0-1 |
weasyprintPyPI |
through 68.1, plus listed versions 0.10.100.110.120.13 Show 45 moreShow less0.140.150.160.170.17.10.180.190.19.10.19.20.20.2.10.2.20.200.20.10.20.20.210.220.230.240.250.260.270.280.290.30.3.10.300.310.320.330.340.350.360.370.380.390.40.400.410.420.42.10.42.20.42.30.50.6 |
None known |
weasyprintUbuntu:20.04:LTS |
All versions, plus listed versions 50-251-151-2 |
None known |
weasyprintUbuntu:22.04:LTS |
All versions, plus listed versions 51-251-353.4-154.0-154.1-1 |
None known |
weasyprintUbuntu:24.04:LTS |
All versions, plus listed versions 59.0-160.2-161.0-161.1-1 |
None known |
weasyprintUbuntu:25.10 |
All versions, plus listed versions 62.3-1 |
None known |
weasyprintUbuntu:26.10 |
All versions, plus listed versions 67.0-169.0-169.0-2 |
None known |
weasyprintUbuntu:26.04:LTS |
All versions, plus listed versions 62.3-162.3-1build167.0-1 |
None known |
python-weasyprintopenSUSE:Tumbleweed |
before 69.0-1.1 | 69.0-1.1 |
python-weasyprintopenSUSE:Leap 16.0 |
before 65.1-bp160.3.1 | 65.1-bp160.3.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-49452 is a medium vulnerability (CVSS 6.5) in Kozea Weasyprint, published July 6, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.37%, the 31st percentile. Fixed in weasyprint 69.0-1.
References
github.com/Kozea/WeasyPrint/security/advisories/GHSA-jhhc-3hcp-qhm5
github.com/Kozea/WeasyPrint/pull/2773
github.com/Kozea/WeasyPrint/commit/e158264e33fa399b29f415d30719c1d85a55df1d
github.com/Kozea/WeasyPrint/releases/tag/v69.0
github.com/advisories/GHSA-jhhc-3hcp-qhm5
github.com/CVEProject/cvelistV5/tree/main/cves/2026/49xxx/CVE-2026-49452.json
Show 9 moreShow less
nvd.nist.gov/vuln/detail/CVE-2026-49452
security-tracker.debian.org/tracker/CVE-2026-49452
github.com/Kozea/WeasyPrint
pypi.org/project/weasyprint
ubuntu.com/security/CVE-2026-49452
cve.org/CVERecord?id=CVE-2026-49452
courtbouillon.org/blog/00067-weasyprint-69
suse.com/security/cve/CVE-2026-49452
bugzilla.suse.com/1270401
Left out here: 67 versions. The JSON record has them.