Files
tmail-flutter/core/lib/presentation/utils
Benoit TELLIERandClaude Opus 5.5 a76b6dd519 fix(html): apply property allow-list and url() validation to nested CSS
The sanitize_html fork preserves stylesheets containing nested blocks
(@media, @supports, @keyframes, @font-face...) after a token blocklist
only, skipping the CSS property allow-list applied to flat stylesheets.
Received emails could therefore use arbitrary properties (e.g. fixed
positioned overlays redressing the UI) and at-rules fetching remote
resources.

Add SanitizeNestedStyleTransformer, run after the sanitizer in the
viewer, standard, reply/forward and signature pipelines:
- keep @media blocks with their rules sanitized,
- drop every other at-rule,
- sanitize plain rules with the fork's CssSanitizer.

The same fix should eventually move into the sanitize_html fork itself.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 10:55:06 +02:00
..