CVE-2024-39317: Wagtail Wagtail Regular Expression Denial-of-service Vulnerability
HIGHCVE-2024-39317 is a HIGH (CVSS 6.5) wagtail regular expression denial-of-service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Wagtail libraries in the PyPI ecosystem. The issue involves wagtail regular expression denial-of-service via search query parsing. Remediation is available by upgrading affected packages to version 6.0.6, 6.1.3, 5.2.6.
CVE-2024-39317 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2024-39317
To remediate this vulnerability, upgrade all affected Wagtail dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install wagtail>=6.0.6
pip install wagtail>=6.1.3
pip install wagtail>=5.2.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show wagtail
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-39317, inspect your installed packages using pip:
pip show wagtail
Analyze the terminal output to locate any version of Wagtail in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.0.6), your application is affected.
Note: The pip show wagtail command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Wagtail, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-39317 Affected Wagtail Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
wagtail
|
PyPI |
≥ 6.0
< 6.0.6
|
6.0.6
|
|
wagtail
|
PyPI |
≥ 6.1
< 6.1.3
|
6.1.3
|
|
wagtail
|
PyPI |
≥ 2.0
< 5.2.6
|
5.2.6
|
References
Frequently Asked Questions
What is CVE-2024-39317?
Which Wagtail versions are affected?
What version fixes CVE-2024-39317?
Is wagtail affected?
What is the CVSS score of CVE-2024-39317?
What CWE is associated with CVE-2024-39317?
How can I check PyPI dependencies for CVE-2024-39317?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jmp3-39vp-fwg8",
"modified" : "2026-06-09T13:05:34Z",
"published" : "2024-07-11T13:21:42Z",
"aliases" : [ "CVE-2024-39317" ],
"summary" : "Wagtail regular expression denial-of-service via search query parsing",
"details" : "### Impact\n\nA bug in Wagtail's [`parse_query_string`](https://docs.wagtail.org/en/stable/topics/search/searching.html#wagtailsearch-query-string-parsing) would result in it taking a long time to process suitably crafted inputs. When used to parse sufficiently long strings of characters without a space, `parse_query_string` would take an unexpectedly large amount of time to process, resulting in a denial of service.\n\nIn an initial Wagtail installation, the vulnerability can be exploited by any Wagtail admin user. It cannot be exploited by end users. If your Wagtail site has a custom search implementation which uses `parse_query_string`, it may be exploitable by other users (e.g. unauthenticated users).\n\n### Patches\n\nPatched versions have been released as Wagtail 5.2.6, 6.0.6 and 6.1.3.\n\nThis vulnerability affects all unpatched versions from Wagtail 2.0 onwards.\n\n### Workarounds\n\nSite owners who are unable to upgrade to a patched version can limit the length of search terms passed to `parse_query_string`. Whilst the performance characteristics will depend on your hosting environment, 1000 characters has been shown to still be fairly fast, without triggering this vulnerability.\n\nNo workaround is available for the Wagtail admin usage.\n\n### Acknowledgements\n\nMany thanks to [Jake Howard](https://github.com/RealOrangeOne) for reporting this issue.\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n* Visit Wagtail's [support channels](https://docs.wagtail.io/en/stable/support.html)\n* Email us at [security@wagtail.org](mailto:security@wagtail.org) (view our [security policy](https://github.com/wagtail/wagtail/security/policy) for more information).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "wagtail"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0"
}, {
"fixed" : "6.0.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "wagtail"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.1"
}, {
"fixed" : "6.1.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "wagtail"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0"
}, {
"fixed" : "5.2.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/wagtail/wagtail/security/advisories/GHSA-jmp3-39vp-fwg8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-39317"
}, {
"type" : "WEB",
"url" : "https://github.com/wagtail/wagtail/commit/31b1e8532dfb1b70d8d37d22aff9cbde9109cdf2"
}, {
"type" : "WEB",
"url" : "https://github.com/wagtail/wagtail/commit/3c941136f79c48446e3858df46e5b668d7f83797"
}, {
"type" : "WEB",
"url" : "https://github.com/wagtail/wagtail/commit/b783c096b6d4fd2cfc05f9137a0be288850e99a2"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/wagtail/PYSEC-2024-86.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/wagtail/wagtail"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-11T13:21:42Z",
"nvd_published_at" : "2024-07-11T16:15:02Z"
}
}