CVE-2024-39317: Wagtail regular expression denial-of-service via search query parsing
Impact
A bug in Wagtail's parsequerystring 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, parsequerystring would take an unexpectedly large amount of time to process, resulting in a denial of service.
In 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 parsequerystring, it may be exploitable by other users (e.g. unauthenticated users).
Patches
Patched versions have been released as Wagtail 5.2.6, 6.0.6 and 6.1.3.
This vulnerability affects all unpatched versions from Wagtail 2.0 onwards.
Workarounds
Site owners who are unable to upgrade to a patched version can limit the length of search terms passed to parsequerystring. Whilst the performance characteristics will depend on your hosting environment, 1000 characters has been shown to still be fairly fast, without triggering this vulnerability.
No workaround is available for the Wagtail admin usage.
Acknowledgements
Many thanks to Jake Howard for reporting this issue.
For more information If you have any questions or comments about this advisory:
Visit Wagtail's support channels Email us at security@wagtail.org (view our security policy for more information).
Other sources
Wagtail is an open source content management system built on Django. A bug in Wagtail's parsequerystring 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, parsequerystring would take an unexpectedly large amount of time to process, resulting in a denial of service. In 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 parsequerystring, it may be exploitable by other users (e.g. unauthenticated users). Patched versions have been released as Wagtail 5.2.6, 6.0.6 and 6.1.3.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-39317?
CVE-2024-39317 has a high severity due to the potential for denial of service through long input strings.
How do I fix CVE-2024-39317?
To fix CVE-2024-39317, upgrade Wagtail to version 5.2.6 or 6.0.6 or later.
What versions of Wagtail are affected by CVE-2024-39317?
CVE-2024-39317 affects Wagtail versions from 2.0 up to 5.2.6 and from 6.0 up to 6.1.3.
What is the impact of CVE-2024-39317?
The impact of CVE-2024-39317 is that it can lead to increased processing times and potential denial of service.
Is there any workaround for CVE-2024-39317?
There are no known workarounds for CVE-2024-39317; upgrading to the patched versions is the only solution.