CVE-2024-39317: Wagtail ReDoS in parse_query_string

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), Wagtail. Vendors: PyPI, 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
    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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.