CVE-2026-23499: Django Unsafe Static Media Serve

Serving uploaded media files using Django's `static()` without overriding the default view allows files to be served inline based on their inferred mimetype. This can lead to Stored XSS if users upload malicious HTML or SVG files. To mitigate this vector during local serving or debug testing, override the `view` parameter with a custom handler that enforces

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-23499-django-unsafe-static-media-serve --engine opengrep

Description

Serving uploaded media files using Django's `static()` without overriding the default view allows files to be served inline based on their inferred mimetype. This can lead to Stored XSS if users upload malicious HTML or SVG files. To mitigate this vector during local serving or debug testing, override the `view` parameter with a custom handler that enforces