Skip to content

Conversation

@nicolas-grekas
Copy link
Member

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

The srcdoc attribute is unlisted from the standard attributes to prevent potential misconfiguration. It must now be explicitly enabled, and it is STRONGLY advised to ->forceAttribute('iframe', 'sandbox', '') when doing so.

Submitting as a bugfix because the current defaults are a foot-gun.

The `srcdoc` attribute is unlisted from the standard attributes to prevent potential misconfiguration.
It must now be explicitly enabled, and it is STRONGLY advised to `->forceAttribute('iframe', 'sandbox', '')` when doing so.
A new test ensures that `<iframe>` elements with unsafe attributes, including `srcdoc`, are sanitized correctly.
@fabpot
Copy link
Member

fabpot commented Oct 29, 2025

Thank you @nicolas-grekas.

@fabpot fabpot merged commit d46e8e7 into symfony:6.4 Oct 29, 2025
11 checks passed
@nicolas-grekas nicolas-grekas deleted the sanitizer-safer branch October 29, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants