CVE-2026-28222: Wagtail Cross-site Scripting Vulnerability in TableBlock Class Attributes
Summary
CVE-2026-28222: Wagtail Vulnerable to Cross-site Scripting in TableBlock class attributes. Affects wagtail across 4 version ranges.
< 6.3.8
>= 6.4rc1, < 7.0.6
>= 7.1rc1, < 7.2.3
>= 7.3rc1, < 7.3.1
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Wagtail is an open-source content management system (CMS) built on Django, designed for managing and publishing content on websites. It features a flexible StreamField that allows users to create complex layouts using various block types, including TableBlock. However, a vulnerability exists in the TableBlock class, which can be exploited to execute arbitrary JavaScript code through crafted class attributes.
Vulnerability Detail
A stored Cross-site Scripting (XSS) vulnerability is present in the rendering of TableBlock blocks within a StreamField. Users with permissions to create or edit pages containing these blocks can set malicious class attributes that execute JavaScript when the page is viewed. This poses a risk, particularly when viewed by users with higher privileges, as it could lead to unauthorized actions being performed with their credentials. The vulnerability specifically affects sites utilizing the TableBlock feature.
How To Fix
Latest published version: 8.0.1 as of 23 Oct 2026
pip install --upgrade "wagtail==8.0.1"
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 6.3.86.3.8pip install --upgrade "wagtail==6.3.8" -
>= 6.4rc1, < 7.0.67.0.6pip install --upgrade "wagtail==7.0.6" -
>= 7.1rc1, < 7.2.37.2.3pip install --upgrade "wagtail==7.2.3" -
>= 7.3rc1, < 7.3.17.3.1pip install --upgrade "wagtail==7.3.1"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
If upgrading is not feasible, you can mitigate the vulnerability by setting a template attribute on all TableBlock definitions. This template should not output class attributes. Here is an example of how to define a TableBlock with a secure template:
<!-- For use with TableBlock(template="path/to/table_block.html") -->
<table>
{% if table_caption %}
<caption>{{ table_caption }}</caption>
{% endif %}
{% if table_header %}
<thead>
<tr>
{% for cell in table_header %}
<th scope="col">{{ cell }}</th>
{% endfor %}
</tr>
</thead>
{% endif %}
<tbody>
{% for row in data %}
<tr>
{% for cell in row %}
{% if first_col_is_header and forloop.first %}
<th scope="row">{{ cell }}</th>
{% else %}
<td>{{ cell }}</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
Conclusion
The vulnerability identified as CVE-2026-28222 in Wagtail poses a significant risk due to its potential for Cross-site Scripting attacks. It is crucial for users to either upgrade to the patched versions or implement the suggested workarounds to safeguard their applications.
See every vulnerability recorded for wagtail →
FAQ
The vulnerability is a stored Cross-site Scripting (XSS) issue that allows attackers to execute arbitrary JavaScript code through crafted class attributes in TableBlock.
Only users with access to the Wagtail admin interface who can create or edit pages containing TableBlock are affected. Ordinary site visitors are not at risk.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.
If upgrading is not possible, implement the provided workaround by setting a secure template for your TableBlock definitions to prevent the output of class attributes.
The CVSS score for this vulnerability is 6.1, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for wagtail.