Skip to content

Wagtail regular expression denial-of-service via search query parsing

Moderate severity GitHub Reviewed Published Jul 11, 2024 in wagtail/wagtail • Updated Jul 31, 2024

Package

pip wagtail (pip)

Affected versions

< 5.2.6
>= 6.0, < 6.0.6
>= 6.1, < 6.1.3

Patched versions

5.2.6
6.0.6
6.1.3

Description

Impact

A bug in Wagtail's parse_query_string 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.

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 parse_query_string, 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 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.

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:

References

@gasman gasman published to wagtail/wagtail Jul 11, 2024
Published to the GitHub Advisory Database Jul 11, 2024
Reviewed Jul 11, 2024
Published by the National Vulnerability Database Jul 11, 2024
Last updated Jul 31, 2024

Severity

Moderate
6.5
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Weaknesses

CVE ID

CVE-2024-39317

GHSA ID

GHSA-jmp3-39vp-fwg8

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.