CVE-2026-54260: Wagtail: Denial of service via unbounded filter specs in the image preview
Impact
An authenticated admin user can trigger expensive rendition processing with purposefully crafted filter specs resulting in potentially service degradation.
The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin.
Patches Patched versions have been released as Wagtail 7.0.8, 7.3.3, 7.4.2.
Workarounds For sites that cannot easily upgrade to a current supported version, the vulnerability can be patched by adding the following code to urls.py URL pattern declarations to override the vulnerable view.
python from django.core.exceptions import PermissionDenied from django.http import HttpResponseBadRequest from django.shortcuts import getobjector404 from django.urls import path from wagtail.admin import urls as wagtailadminurls from wagtail.images.exceptions import InvalidFilterSpecError from wagtail.images.permissions import permissionpolicy from wagtail.images.views import preview
def patchedpreview(request, imageid, filterspec): image = getobjector404(getimagemodel(), id=imageid)
if not permissionpolicy.userhaspermissionforinstance(request.user, "change", image): raise PermissionDenied
try: filterobj = Filter(spec=filterspec) except InvalidFilterSpecError: return HttpResponseBadRequest("Invalid filter spec", contenttype="text/plain")
allowed = {"original", "width", "height", "min", "max", "fill"} if any(operation.method not in allowed for operation in filterobj.operations): return HttpResponseBadRequest("Invalid filter spec", contenttype="text/plain")
return preview(request, imageid, filterspec)
urlpatterns = [ # Example where the CMS admin is at /admin/. # Add this before the Wagtail admin URLs registration, with the same sub-path. path("admin/images/<int:imageid>/preview/<str:filterspec>/", patchedpreview) path("admin/", include(wagtailadminurls)), ]
Acknowledgements Many thanks to @0x1saac 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. In versions prior to 7.0.8, 7.3.3 and 7.4.2, an authenticated admin user can trigger expensive rendition processing with purposefully crafted filter specs resulting in potentially service degradation. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin. This issue has been fixed in versions 7.0.8, 7.3.3, and 7.4.2.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/wagtailto a version that resolves this vulnerability.Fixed in 7.4.2 - Upgrade
Upgrade
pip/wagtailto a version that resolves this vulnerability.Fixed in 7.3.3 - Upgrade
Upgrade
pip/wagtailto a version that resolves this vulnerability.Fixed in 7.0.8 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.0.8 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.3.3 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.4.2 - Configuration
For sites that cannot upgrade, patch by overriding the vulnerable image preview view in `urls.py` URL pattern declarations: add the provided `patched_preview` function and register `path('admin/images/<int:image_id>/preview/<str:filter_spec>/', patched_preview)` (with the CMS admin sub-path as used by the site, e.g., `/admin/`).
Wagtail (Django urls.py) URL pattern override for image preview filters = path('admin/images/<int:image_id>/preview/<str:filter_spec>/', patched_preview) - Configuration
In `patched_preview`, restrict `filter_obj.operations` so that only operations in the literal `allowed = {"original", "width", "height", "min", "max", "fill"}` are accepted; reject invalid filter specs by raising `InvalidFilterSpecError` handling (return `HttpResponseBadRequest("Invalid filter spec", content_type="text/plain")`).
patched_preview (Wagtail image preview) allowed filter operations = {"original","width","height","min","max","fill"} - Configuration
In `patched_preview`, enforce authorization by checking `permission_policy.user_has_permission_for_instance(request.user, 'change', image)` before calling `preview(request, image_id, filter_spec)`; if unauthorized, raise `PermissionDenied` after loading the image with `get_object_or_404(get_image_model(), id=image_id)`.
patched_preview (Wagtail image preview) permission enforcement for filter preview = permission_policy.user_has_permission_for_instance(request.user, 'change', image)
Event History
Frequently Asked Questions
What is the severity of CVE-2026-54260?
CVE-2026-54260 has a medium severity rating of 4.3.
How do I fix CVE-2026-54260?
To fix CVE-2026-54260, upgrade to Wagtail versions 7.0.8, 7.3.3, or 7.4.2 or later.
Who is affected by CVE-2026-54260?
Authenticated admin users in versions prior to 7.0.8, 7.3.3, and 7.4.2 of Wagtail are affected by CVE-2026-54260.
What type of attack does CVE-2026-54260 facilitate?
CVE-2026-54260 facilitates a denial of service attack through unbounded filter specs in the image preview.
Is CVE-2026-54260 exploitable remotely?
No, CVE-2026-54260 is not remote; an authenticated admin user must exploit it.