Improper escaping of HTML ('Cross-site Scripting') in Wagtail StreamField blocks
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
Wagtail is an open source content management system built on Django. A cross-site scripting vulnerability exists in versions 2.13-2.13.1, versions 2.12-2.12.4, and versions prior to 2.11.8. When the `{% include_block %}` template tag is used to output the value of a plain-text StreamField block (`CharBlock`, `TextBlock` or a similar user-defined block derived from `FieldBlock`), and that block does not specify a template for rendering, the tag output is not properly escaped as HTML. This could allow users to insert arbitrary HTML or scripting. This vulnerability is only exploitable by users with the ability to author StreamField content (i.e. users with 'editor' access to the Wagtail admin). Patched versions have been released as Wagtail 2.11.8 (for the LTS 2.11 branch), Wagtail 2.12.5, and Wagtail 2.13.2 (for the current 2.13 branch). As a workaround, site implementors who are unable to upgrade to a current supported version should audit their use of `{% include_block %}` to ensure it is not used to output `CharBlock` / `TextBlock` values with no associated template. Note that this only applies where `{% include_block %}` is used directly on that block (uses of `include_block` on a block _containing_ a CharBlock / TextBlock, such as a StructBlock, are unaffected). In these cases, the tag can be replaced with Django's `{{ ... }}` syntax - e.g. `{% include_block my_title_block %}` becomes `{{ my_title_block }}`.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| wagtail | wagtail | before 2.11.8; 2.12 – 2.12.4; 2.13 – 2.13.1 | 2.11.8 | Patch available | CNA |
| — | wagtail (PyPI) | before 2.11.8 | 2.11.8 | Patch available | GHSA-xfrw-hxr5-ghqf |
| — | wagtail (PyPI) | 2.12 to before 2.12.5 | 2.12.5 | Patch available | GHSA-xfrw-hxr5-ghqf |
| — | wagtail (PyPI) | 2.13 to before 2.13.2 | 2.13.2 | Patch available | GHSA-xfrw-hxr5-ghqf |
- wagtail Vendorwagtail Affected before 2.11.8; 2.12 – 2.12.4; 2.13 – 2.13.1 Fixed in 2.11.8 Patch available CNA
- wagtail (PyPI) Vendor— Affected before 2.11.8 Fixed in 2.11.8 Patch available GHSA-xfrw-hxr5-ghqf
- wagtail (PyPI) Vendor— Affected 2.12 to before 2.12.5 Fixed in 2.12.5 Patch available GHSA-xfrw-hxr5-ghqf
- wagtail (PyPI) Vendor— Affected 2.13 to before 2.13.2 Fixed in 2.13.2 Patch available GHSA-xfrw-hxr5-ghqf
Remediation
- Fix · CNA wagtail (wagtail) Fixed in 2.11.8
- Fix · GHSA-xfrw-hxr5-ghqf wagtail (PyPI) Fixed in 2.11.8 Advisory →
- Fix · GHSA-xfrw-hxr5-ghqf wagtail (PyPI) Fixed in 2.12.5 Advisory →
- Fix · GHSA-xfrw-hxr5-ghqf wagtail (PyPI) Fixed in 2.13.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2021-32681
- 2026-10-03 Alias added: GHSA-xfrw-hxr5-ghqf
References
Exploit 3
Advisory 2
More Wagtail vulnerabilities
- TI-2026-39163 Wagtail: Reflected XSS in dynamic image URL generator view CVSS 3.1HIGH 7.3
- TI-2020-08875 Possible XSS attack in Wagtail CVSS 3.1MEDIUM 6.8
- TI-2023-13342 Wagtail vulnerable to stored Cross-site Scripting attack via ModelAdmin views CVSS 3.1MEDIUM 6.4
- TI-2026-32180 Wagtail: Improper restriction handling on Documents and Images API CVSS 3.1MEDIUM 5.3
- TI-2026-22558 Wagtail: Improper escaping of HTML (Cross-site Scripting) in simple_translation admin interface CVSS 3.1MEDIUM 6.1
- TI-2026-22557 Wagtail: Improper escaping of HTML (Cross-site Scripting) on TableBlock class attributes CVSS 3.1MEDIUM 6.1
Sources
- CVE-2021-32681 · CVE Program
- CVE-2021-32681 · NVD
- FIRST EPSS
- GHSA-xfrw-hxr5-ghqf · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences