# CVE-2021-32681: Wagtail XSS in StreamField include_block tag

Source: https://junglewise.ai/threats/cve-2021-32681-wagtail-xss-in-streamfield-include-block-tag  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-06-17. Updated: 2026-06-09  
License: CC BY 4.0 with a link back

CVE-2021-32681 · Severity: medium · CVSS 5.4 · Published 2021-06-17

Wagtail is a content management system used to build and manage websites. A security flaw allows users with 'editor' permissions to insert malicious scripts into certain text fields. If exploited, this could lead to unauthorized actions being performed in the browser of other site visitors or administrators, potentially compromising user sessions or site integrity.

Technologies: [wagtail (PyPI)](https://junglewise.ai/threats/technologies/pypi-wagtail), [Wagtail](https://junglewise.ai/threats/technologies/wagtail). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi), [Wagtail](https://junglewise.ai/threats/vendors/wagtail).

## Quick answers

**Is CVE-2021-32681 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-32681 being exploited in the wild.

**How severe is CVE-2021-32681?** Medium severity, with a CVSS score of 5.4, published 17 June 2021.

**Which products and versions are affected?** wagtail (PyPI) ECOSYSTEM:introduced=0,fixed=2.11.8, ECOSYSTEM:introduced=0,fixed=2.11.8,introduced=2.12,fixed=2.12.5,introduced=2.13,fixed=2.13.2; Wagtail < 2.11.8, >= 2.12 < 2.12.5, >= 2.13 < 2.13.2.

**Is there a fix for CVE-2021-32681?** Yes. wagtail (PyPI): upgrade to 2.11.8, 2.13.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2021-32681 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2021-32681?** Check whether you run wagtail (PyPI) or Wagtail at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- wagtail (PyPI): upgrade to 2.11.8, 2.13.2 or later

  ```sh
  pip install "wagtail>=2.13.2"
  ```


## Technical details

A stored cross-site scripting (XSS) vulnerability exists in Wagtail's StreamField component. When the '{% include_block %}' template tag is used to render plain-text blocks like 'CharBlock' or 'TextBlock' without a specific rendering template, the output is not properly HTML-escaped. An attacker with 'editor' access can input malicious scripts into these fields, which are then executed when the content is viewed by others. The issue is rooted in the 'FieldBlock' class and its derivatives. Patches are available in versions 2.11.8, 2.12.5, and 2.13.2.

## Affected products

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

## Identifiers

- CVE-2021-32681
- GHSA-xfrw-hxr5-ghqf
- PYSEC-2021-103

## Timeline

- 2021-06-17: disclosed
- 2021-06-17: advisory
- 2021-06-17: patched

## References

- [https://github.com/wagtail/wagtail/security/advisories/GHSA-xfrw-hxr5-ghqf](https://github.com/wagtail/wagtail/security/advisories/GHSA-xfrw-hxr5-ghqf)
- [https://github.com/wagtail/wagtail/releases/tag/v2.11.8](https://github.com/wagtail/wagtail/releases/tag/v2.11.8)
- [https://github.com/wagtail/wagtail/releases/tag/v2.12.5](https://github.com/wagtail/wagtail/releases/tag/v2.12.5)
- [https://github.com/wagtail/wagtail/releases/tag/v2.13.2](https://github.com/wagtail/wagtail/releases/tag/v2.13.2)
- [https://github.com/pypa/advisory-database/tree/main/vulns/wagtail/PYSEC-2021-103.yaml](https://github.com/pypa/advisory-database/tree/main/vulns/wagtail/PYSEC-2021-103.yaml)

## Related threats

- [Wagtail permission bypass in copy page for translation](https://junglewise.ai/threats/cve-2026-125106-wagtail-is-an-open-source-content-management-system-built-on)
- [Wagtail Documents and Images API access control bypass](https://junglewise.ai/threats/cve-2026-123820-wagtail-is-an-open-source-content-management-system-built-on)
- [Wagtail snippet copy permission bypass](https://junglewise.ai/threats/cve-2026-123819-wagtail-is-an-open-source-content-management-system-built-on)
- [Wagtail Pages admin API improper access control](https://junglewise.ai/threats/cve-2026-55468-wagtail-pages-admin-api-improper-access-control)
- [Wagtail improper permission restriction on page translation API](https://junglewise.ai/threats/wagtail-improper-permission-restriction-on-page-translation-api-871f4804)
