CVE-2026-28222: Wagtail Cross-site Scripting Vulnerability in TableBlock Class Attributes

wagtail Updated 04 Mar 2026

Summary

03/03/2026
Yes i
Moderate
6.1

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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.8 6.3.8
    pip install --upgrade "wagtail==6.3.8"
  • >= 6.4rc1, < 7.0.6 7.0.6
    pip install --upgrade "wagtail==7.0.6"
  • >= 7.1rc1, < 7.2.3 7.2.3
    pip install --upgrade "wagtail==7.2.3"
  • >= 7.3rc1, < 7.3.1 7.3.1
    pip 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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for wagtail.

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.8 6.3.8
    pip install --upgrade "wagtail==6.3.8"
  • >= 6.4rc1, < 7.0.6 7.0.6
    pip install --upgrade "wagtail==7.0.6"
  • >= 7.1rc1, < 7.2.3 7.2.3
    pip install --upgrade "wagtail==7.2.3"
  • >= 7.3rc1, < 7.3.1 7.3.1
    pip 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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback