Every CVE Search/ Get API key

CVE-2026-49452

WeasyPrint: CSS Injection via Presentational Hints

6.5 MediumFix available

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

0.37%Up 0.1 points since Aug 19, 2026
90%50%10%1%

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 MediumCVSS: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 MediumCVSS: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

Record
GHSA-jhhc-3hcp-qhm5
CVSS 3.1
6.5 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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

Record
GHSA-jhhc-3hcp-qhm5
CVSS 3.1
6.5 MediumCVSS: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

Record
PYSEC-2026-3412
CVSS 3.1
6.5 MediumCVSS: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 MediumCVSS: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

Affected packages
PackageAffectedFixed
weasyprint
PyPI
through 68.1 None known
weasyprint
Debian:12
All versions, plus listed versions
57.2-159.0-160.2-161.0-161.1-1
Show 10 moreShow less
61.2-161.2-262.0-162.1-162.2-162.3-167.0-169.0-169.0-270.0-1
None known
weasyprint
Debian:13
All versions, plus listed versions
62.3-167.0-169.0-169.0-270.0-1
None known
weasyprint
Debian:14
before 69.0-1, plus listed versions
62.3-167.0-1
69.0-1
weasyprint
PyPI
through 68.1, plus listed versions
0.10.100.110.120.13
Show 45 moreShow less
0.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
weasyprint
Ubuntu:20.04:LTS
All versions, plus listed versions
50-251-151-2
None known
weasyprint
Ubuntu:22.04:LTS
All versions, plus listed versions
51-251-353.4-154.0-154.1-1
None known
weasyprint
Ubuntu:24.04:LTS
All versions, plus listed versions
59.0-160.2-161.0-161.1-1
None known
weasyprint
Ubuntu:25.10
All versions, plus listed versions
62.3-1
None known
weasyprint
Ubuntu:26.10
All versions, plus listed versions
67.0-169.0-169.0-2
None known
weasyprint
Ubuntu:26.04:LTS
All versions, plus listed versions
62.3-162.3-1build167.0-1
None known
python-weasyprint
openSUSE:Tumbleweed
before 69.0-1.1
69.0-1.1
python-weasyprint
openSUSE:Leap 16.0
before 65.1-bp160.3.1
65.1-bp160.3.1

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE 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

Show 9 moreShow less
This page doesn't list everything

Left out here: 67 versions. The JSON record has them.

MoveEnter Open