CVE-2026-54261: Wagtail: Improper permission handling in image preview
Impact Due to a missing permission check on the image preview endpoint, a user with access to the Wagtail admin can preview any image. The existing data of the image object itself is not exposed. 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.shortcuts import getobjector404 from django.urls import path from wagtail.admin import urls as wagtailadminurls 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
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 and @harshakshit 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, due to a missing permission check on the image preview endpoint, a user with access to the Wagtail admin can preview any image. The existing data of the image object itself is not exposed. 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
wagtailto a version that resolves this vulnerability.Fixed in 7.0.8 - Upgrade
Upgrade
wagtailto a version that resolves this vulnerability.Fixed in 7.3.3 - Upgrade
Upgrade
wagtailto a version that resolves this vulnerability.Fixed in 7.4.2 - Configuration
For sites that cannot upgrade, patch the vulnerable image preview endpoint by adding a URL pattern override in urls.py to route /admin/images/<int:image_id>/preview/<str:filter_spec>/ to a patched_preview view (instead of the vulnerable view), and in patched_preview enforce permissions using permission_policy.user_has_permission_for_instance(request.user, "change", image); raise PermissionDenied when permission is not granted.
Wagtail (Django urls.py override) URL pattern for image preview endpoint = path("admin/images/<int:image_id>/preview/<str:filter_spec>/", patched_preview)
Event History
Frequently Asked Questions
What is the severity of CVE-2026-54261?
The severity of CVE-2026-54261 is rated as medium with a score of 6.5.
How do I fix CVE-2026-54261?
To fix CVE-2026-54261, upgrade to Wagtail version 7.0.8, 7.3.3, or 7.4.2 or later.
What systems are affected by CVE-2026-54261?
CVE-2026-54261 affects Wagtail versions prior to 7.0.8, 7.3.3, and 7.4.2.
What type of vulnerability is CVE-2026-54261?
CVE-2026-54261 is an improper permission handling vulnerability affecting the image preview functionality.
Can a low privilege user exploit CVE-2026-54261?
Yes, a low privilege user with access to the Wagtail admin can exploit CVE-2026-54261 to preview any image.