CVE-2021-32681: Cross-site Scripting in wagtail

wagtail Updated 02 Oct 2025

Summary

17/06/2021
Yes i
Moderate
5.4

CVE-2021-32681: Cross-site Scripting in wagtail. Affects wagtail across 3 version ranges.

< 2.11.8 >= 2.12, < 2.12.5 >= 2.13, < 2.13.2

Fixed in 2.11.8, 2.12.5 or 2.13.2, depending 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Wagtail is an open-source content management system (CMS) built on Django, designed to provide a user-friendly interface for managing website content. It utilizes a StreamField feature that allows users to create dynamic content blocks. However, when the {% include_block %} template tag is used to output the value of a plain-text StreamField block without a specified rendering template, the tag output is not properly escaped as HTML. This vulnerability can be exploited by users with 'editor' access to the Wagtail admin, enabling them to insert arbitrary HTML or scripting.

Vulnerability Detail

The vulnerability arises from the lack of proper HTML escaping in the {% include_block %} template tag when rendering plain-text StreamField blocks. This allows users with 'editor' access to the Wagtail admin to inject arbitrary HTML or scripting. The impact of this vulnerability is limited to users who can author StreamField content. The vulnerability has a CVSS score of 5.4, indicating a moderate severity level.

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.

  • < 2.11.8 2.11.8
    pip install --upgrade "wagtail==2.11.8"
  • >= 2.12, < 2.12.5 2.12.5
    pip install --upgrade "wagtail==2.12.5"
  • >= 2.13, < 2.13.2 2.13.2
    pip install --upgrade "wagtail==2.13.2"

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 to a patched version is not feasible, site implementors should audit their use of {% include_block %} to ensure it is not used to output CharBlock / TextBlock values without an associated template. In such cases, the tag can be replaced with Django's {{ ... }} syntax. For example, {% include_block my_title_block %} becomes {{ my_title_block }}.

Conclusion

The Cross-site Scripting vulnerability in wagtail allows users with 'editor' access to inject arbitrary HTML or scripting. Upgrading to the patched versions or applying the recommended workarounds will mitigate this vulnerability. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for wagtail →

Share this vulnerability

FAQ

Wagtail is an open-source content management system (CMS) built on Django, providing a user-friendly interface for managing website content.

The vulnerability allows users with 'editor' access to the Wagtail admin to inject arbitrary HTML or scripting when using the {% include_block %} template tag to output plain-text StreamField blocks without a specified rendering template.

Only users with the ability to author StreamField content (i.e., users with 'editor' access to the Wagtail admin) can exploit this vulnerability.

To fix this vulnerability, it is recommended to upgrade to the patched versions of Wagtail: 2.11.8 (for the LTS 2.11 branch), 2.12.5, or 2.13.2 (for the current 2.13 branch). Alternatively, you can disable escaping by surrounding the relevant {% include_block %} tag with {% autoescape off %}...{% endautoescape %}.

If upgrading to a patched version is not possible, you can audit your use of {% include_block %} to ensure it is not used to output CharBlock / TextBlock values without an associated template. In such cases, you can replace the tag with Django's {{ ... }} syntax.

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.

  • < 2.11.8 2.11.8
    pip install --upgrade "wagtail==2.11.8"
  • >= 2.12, < 2.12.5 2.12.5
    pip install --upgrade "wagtail==2.12.5"
  • >= 2.13, < 2.13.2 2.13.2
    pip install --upgrade "wagtail==2.13.2"

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