Skip to content

Wagtail vulnerable to denial-of-service via memory exhaustion when uploading large files

Moderate severity GitHub Reviewed Published Apr 3, 2023 in wagtail/wagtail • Updated Apr 3, 2023

Package

pip wagtail (pip)

Affected versions

>= 4.2, < 4.2.2
< 4.1.4

Patched versions

4.2.2
4.1.4

Description

Impact

A memory exhaustion bug exists in Wagtail's handling of uploaded images and documents. For both images and documents, files are loaded into memory during upload for additional processing. A user with access to upload images or documents through the Wagtail admin interface could upload a file so large that it results in a crash or denial of service.

The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin. It can only be exploited by admin users with permission to upload images or documents.

Image uploads are restricted to 10MB by default, however this validation only happens on the frontend and on the backend after the vulnerable code.

Patches

Patched versions have been released as Wagtail 4.1.4 (for the LTS 4.1 branch) and Wagtail 4.2.2 (for the current 4.2 branch).

Workarounds

Site owners who are unable to upgrade to the new versions are encouraged to add extra protections outside of Wagtail to limit the size of uploaded files. Exactly how this is done will vary based on your hosting environment, but here are a few references for common setups:

The changes themselves are deep inside Wagtail, making patching incredibly difficult.

References

@gasman gasman published to wagtail/wagtail Apr 3, 2023
Published by the National Vulnerability Database Apr 3, 2023
Published to the GitHub Advisory Database Apr 3, 2023
Reviewed Apr 3, 2023
Last updated Apr 3, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H

EPSS score

0.218%
(60th percentile)

CVE ID

CVE-2023-28837

GHSA ID

GHSA-33pv-vcgh-jfg9

Source code

Credits

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