llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · django-filer

GHSA-2JRW-HP8Q-5VQW

Upload validators bypassed by an unknown Content-Type, allowing stored XSS

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS 3.1
5.4
Media
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche a -51 d de la divulgación
Exposición35 dDesde la divulgación, 16 oct 2026, 6:58 a. m.
Detección33 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 3.5.1
Monitoreo
Detectada +1
26 ago 26
16 oct 26
18 nov 26
21 nov 26
26 ago 26
17 sept 26
8 oct 26
30 oct 26
21 nov 26
FechaFaseEventoDetalle
Remediación Parche 3.5.1 django-filer · -51 d desde divulgación
Divulgación Publicada GHSA-2JRW-HP8Q-5VQW divulgada · CVSS 5.4 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Impact

The AJAX upload endpoint (`filer-ajax_upload`) validated an upload against the MIME type in the client-supplied `Content-Type` of the multipart part. If that type was unknown to Python's `mimetypes` module, the upload skipped both the
check that the file extension matches the declared type and the validators configured in `FILER_FILE_VALIDATORS`. The file was then stored and served under the MIME type derived from its file name.

An authenticated user holding the `filer.add_file` permission could therefore upload, for example, an HTML or SVG file containing script by declaring an arbitrary unregistered type such as `foo/bar`. With the default `FILER_IS_PUBLIC_DEFAULT = True` the file is served publicly from the media origin, giving stored cross-site scripting against anyone who opens the file
URL. `FILER_MIME_TYPE_WHITELIST` did not prevent this.

Because `ajax_upload` was not wrapped in `admin_site.admin_view()`, it did not check `is_staff`: a non-staff user with filer.add_file` could reach the upload URL for files without a folder.

The endpoint was also decorated with `@csrf_exempt`. Django's default `SESSION_COOKIE_SAMESITE = "Lax"` stops a cross-site POST from carrying the session cookie in current browsers, so on a default install this is defense in depth. Deployments that relax `SameSite` were exposed to cross-site uploads.

Separately, a `Content-Type` without a slash, or a mismatch between extension and declared type, raised an uncaught exception and returned HTTP 500.

Patches

Fixed in 3.5.1 (#1610):

- The MIME type of an upload is always derived from the file name (`mimetypes.guess_type(filename)[0] or "application/octet-stream"`). The client-supplied `Content-Type` is no longer used. The validated type is now the same type that is stored and served. Unknown extensions become `application/octet-stream`, which the default validators reject.
- `ajax_upload` is wrapped in `admin_site.admin_view()` (it requires an active staff user) and is no longer `@csrf_exempt`. The bundled uploaders send `X-CSRFToken`.
- Malformed MIME types no longer raise. Upload errors return a JSON error with a 4xx status code instead of HTTP 500 or HTTP 200.

Upgrade to 3.6.0 or later if you use the "Upload Files" button in the folder view: in 3.5.1 that uploader did not yet send the CSRF token, so its uploads failed (#1617).

Behavior changes in 3.5.1: uploads with an extension unknown to `mimetypes` are rejected by the default validators; register the extension with `mimetypes.add_type()` if you need it. Custom clients posting to
`filer-ajax_upload` must send a CSRF token, log in as a staff user, and handle non-2xx responses.

Workarounds

If you cannot upgrade, restrict `filer.add_file` to trusted users, and serve media from a separate origin with `Content-Disposition: attachment` or a restrictive `Content-Security-Policy` for user-uploaded files.

Credits

Reported by Miguel Rafael Martín de Nicolás Acedo (@miguel-hub1).

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:R
NingunaRequerida
AlcanceS:C
CambiadoSin cambio
ConfidencialidadC:L
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
7.2/ 10Alto
Vector 7.2 (fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
django-filer< 3.5.1
3.5.1
3.6.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypidjango-filer
Corregida 3.5.1 -51 d 3.6.0 no afectada
Versiones corregidas3.5.1
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/django-cms/django-filer/security/advisories/GHSA-2jrw-hp8q-5vqw

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.