# CVE-2024-39317: Wagtail ReDoS in parse_query_string

Source: https://junglewise.ai/threats/cve-2024-39317-wagtail-redos-in-parse-query-string  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-07-11. Updated: 2026-06-09  
License: CC BY 4.0 with a link back

CVE-2024-39317 · Severity: medium · CVSS 6.5 · Published 2024-07-11

Wagtail is a popular open-source content management system. A flaw in how it processes search queries allows an attacker to send a specially crafted, long search term that causes the server to become unresponsive. This can lead to a denial-of-service (DoS) condition, making the website or its administration panel unavailable to users.

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-2024-39317 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-39317 being exploited in the wild.

**How severe is CVE-2024-39317?** Medium severity, with a CVSS score of 6.5, published 11 July 2024.

**Which products and versions are affected?** wagtail (PyPI) ECOSYSTEM:introduced=6.0,fixed=6.0.6, GIT:introduced=0,fixed=31b1e8532dfb1b70d8d37d22aff9cbde9109cdf2,fixed=3c941136f79c48446e3858df46e5b668d7f83797,fixed=b783c096b6d4fd2cfc05f9137a0be288850e99a2|ECOSYSTEM:introduced=6.0,fixed=6.0.6,introduced=6.1,fixed=6.1.3,introduced=2.0,fixed=5.2.6; Wagtail >= 2.0, < 5.2.6; >= 6.0, < 6.0.6; >= 6.1, < 6.1.3.

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

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

**Am I affected by CVE-2024-39317?** 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 5.2.6, 6.0.6 or later

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


## Technical details

A Regular Expression Denial of Service (ReDoS) vulnerability exists in Wagtail's 'parse_query_string' function due to inefficient regular expression complexity (CWE-1333). When the function processes long strings of characters without spaces, it incurs catastrophic backtracking, leading to excessive CPU consumption. In a default configuration, the attack requires 'admin' level privileges to exploit via the Wagtail admin interface; however, if a site uses 'parse_query_string' in custom public-facing search implementations, it could be exploited by unauthenticated users. The issue is mitigated in versions 5.2.6, 6.0.6, and 6.1.3. A temporary workaround involves limiting search term inputs to under 1000 characters.

## Affected products

- Wagtail Wagtail >= 2.0, < 5.2.6; >= 6.0, < 6.0.6; >= 6.1, < 6.1.3

## Identifiers

- CVE-2024-39317
- GHSA-jmp3-39vp-fwg8
- PYSEC-2024-86

## Timeline

- 2024-07-11: disclosed
- 2024-07-11: patched
- 2024-07-11: advisory

## References

- [https://api.github.com/users/RealOrangeOne](https://api.github.com/users/RealOrangeOne)
- [https://github.com/RealOrangeOne](https://github.com/RealOrangeOne)
- [https://api.github.com/users/RealOrangeOne/gists%7B/gist_id%7D](https://api.github.com/users/RealOrangeOne/gists%7B/gist_id%7D)
- [https://api.github.com/users/RealOrangeOne/repos](https://api.github.com/users/RealOrangeOne/repos)
- [https://avatars.githubusercontent.com/u/6527489?v=4](https://avatars.githubusercontent.com/u/6527489?v=4)
- [https://api.github.com/users/RealOrangeOne/events%7B/privacy%7D](https://api.github.com/users/RealOrangeOne/events%7B/privacy%7D)

## 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)
