Wagtail Vulnerable to Cross-site Scripting in TableBlock class attributes
Package
Affected versions
< 6.3.8
>= 6.4rc1, < 7.0.6
>= 7.1rc1, < 7.2.3
>= 7.3rc1, < 7.3.1
Patched versions
6.3.8
7.0.6
7.2.3
7.3.1
Description
Published to the GitHub Advisory Database
Mar 3, 2026
Reviewed
Mar 3, 2026
Published by the National Vulnerability Database
Mar 5, 2026
Last updated
Mar 5, 2026
Impact
A stored Cross-site Scripting (XSS) vulnerability exists on rendering
TableBlockblocks within a StreamField. A user with access to create or edit pages containingTableBlockStreamField blocks is able to set specially-craftedclassattributes on the block which run arbitrary JavaScript code when the page is viewed. When viewed by a user with higher privileges, this could lead to performing actions with that user's credentials. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin, and only affects sites using TableBlock.Patches
Patched versions have been released as Wagtail 6.3.8, 7.0.6, 7.2.3 and 7.3.1.
Workarounds
Site owners who are unable to upgrade to the new versions can remediate the vulnerability by setting a
templateattribute on all TableBlock definitions, referencing a template that does not outputclassattributes. For example:Acknowledgements
Many thanks to Guan Chenxian (@GCXWLP) for reporting this issue.
For more information
If there are any questions or comments about this advisory:
References