PT-2026-60023 · Pypi · Weasyprint

Publicado

2026-07-13

·

Atualizado

2026-07-13

CVSS v3.1

6.5

Média

VetorAV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

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

Impact

  • CSS injection
  • Server-side requests via injected url()
  • Limited to cases where presentational hints=True

Suggested Fix

Correção

Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾

Identificadores relacionados

PYSEC-2026-3412

Produtos afetados

Weasyprint