---
id: CVE-2023-28837
aliases:
  - GHSA-33pv-vcgh-jfg9
  - PYSEC-2023-56
title: >-
  Wagtail vulnerable to denial-of-service via memory exhaustion when uploading
  large files
summary: >-
  Wagtail vulnerable to denial-of-service via memory exhaustion when uploading
  large files
severity: medium
cvss: 4.4
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H'
vendor: wagtail
product: wagtail
ecosystem: pip
affected:
  - 'wagtail >= 4.2, < 4.2.2'
  - wagtail < 4.1.4
patched:
  - wagtail 4.2.2
  - wagtail 4.1.4
published: '2023-04-03'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:49:53.230639651Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-33pv-vcgh-jfg9'
references:
  - url: 'https://github.com/wagtail/wagtail/security/advisories/GHSA-33pv-vcgh-jfg9'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2023-28837'
  - url: >-
      https://github.com/wagtail/wagtail/commit/3c0c64642b9e5b8d28b111263c7f4bddad6c3880
  - url: >-
      https://github.com/wagtail/wagtail/commit/c9d2fcd650a88d76ae122646142245e5927a9165
  - url: >-
      https://github.com/wagtail/wagtail/commit/cfa11bbe00dbe7ce8cd4c0bbfe2a898a690df2bf
  - url: >-
      https://github.com/wagtail/wagtail/commit/d4022310cbe497993459c3136311467c7ac6329a
  - url: >-
      https://docs.wagtail.org/en/stable/reference/settings.html#wagtailimages-max-upload-size
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/wagtail/PYSEC-2023-56.yaml
  - url: 'https://github.com/wagtail/wagtail'
  - url: 'https://github.com/wagtail/wagtail/releases/tag/v4.1.4'
  - url: 'https://github.com/wagtail/wagtail/releases/tag/v4.2.2'
tags:
  - osv
  - pip
epss: 0.0107
epssPercentile: 0.63413
ingestedAt: '2026-09-12T03:13:01.642Z'
---

## Overview

### 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](https://docs.wagtail.org/en/stable/reference/settings.html#wagtailimages-max-upload-size), 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:

- Nginx: [`client_max_body_size`](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size)
- Apache: [`LimitRequestBody`](https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestbody)
- Cloudflare: Already [imposes a limit of 100MB - 500MB](https://developers.cloudflare.com/cache/about/default-cache-behavior#customization-options-and-limitations) depending on plan
- CloudFront: [`SizeConstraint`](https://docs.aws.amazon.com/waf/latest/APIReference/API_SizeConstraintStatement.html)
- Traefik: [`traefik.http.middlewares.limit.buffering.maxRequestBodyBytes`](https://doc.traefik.io/traefik/middlewares/http/buffering/#maxrequestbodybytes)

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

## Affected packages

- `wagtail >= 4.2, < 4.2.2`
- `wagtail < 4.1.4`

## Remediation

Upgrade to a patched release:

- `wagtail 4.2.2`
- `wagtail 4.1.4`
