{"id":"CVE-2026-22707","aliases":["CVE-2026-22707","GHSA-pcw7-5633-82vv"],"related":[],"kind":"vulnerability","state":"published","title":"Strapi Upload Plugin MIME Validation Bypass via Content API","summary":"Strapi is an open source headless content management system. In Strapi versions prior to 5.33.3, the Upload plugin's Content API endpoints did not enforce the administrator-configured MIME type restrictions (`plugin.upload.security.allowedTypes` and `deniedTypes`). The same restrictions were correctly enforced on the Admin Panel upload path. The upload plugin's `enforceUploadSecurity` security check was invoked in the admin upload controller but was missing from the Content API controller. The Content API handlers `uploadFiles` and `replaceFile` (and the `upload` wrapper that dispatches to them) called the underlying upload service directly, bypassing both the magic-byte MIME detection and the configured allow/deny lists. An authenticated user with the Content API upload permission could therefore upload file types the administrator had explicitly disallowed, including HTML and SVG content. In deployments serving uploaded files from the same origin as the admin panel (default), an attacker could upload an HTML or SVG file that, when opened directly by an admin, executed JavaScript in the admin origin, enabling admin-session hijack and authenticated administrative actions against the admin API. The patch in version 5.33.3 introduces a shared `prepareUploadRequest` helper that wraps `enforceUploadSecurity` and is called from both the Content API and admin upload controllers, ensuring identical security policy enforcement on every upload entry point.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Strapi is an open source headless content management system. In Strapi versions prior to 5.33.3, the Upload plugin's Content API endpoints did not enforce the administrator-configured MIME type restrictions (`plugin.upload.security.allowedTypes` and `deniedTypes`). The same restrictions were correctly enforced on the Admin Panel upload path. The upload plugin's `enforceUploadSecurity` security check was invoked in the admin upload controller but was missing from the Content API controller. The Content API handlers `uploadFiles` and `replaceFile` (and the `upload` wrapper that dispatches to them) called the underlying upload service directly, bypassing both the magic-byte MIME detection and the configured allow/deny lists. An authenticated user with the Content API upload permission could therefore upload file types the administrator had explicitly disallowed, including HTML and SVG content. In deployments serving uploaded files from the same origin as the admin panel (default), an attacker could upload an HTML or SVG file that, when opened directly by an admin, executed JavaScript in the admin origin, enabling admin-session hijack and authenticated administrative actions against the admin API. The patch in version 5.33.3 introduces a shared `prepareUploadRequest` helper that wraps `enforceUploadSecurity` and is called from both the Content API and admin upload controllers, ensuring identical security policy enforcement on every upload entry point.","source":"cvelist"},{"lang":"en","text":"### Summary of CVE-2026-22707 Vulnerability Details\n\n- CVE: CVE-2026-22707\n- CVSS v3.1 Vector: `CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N` (5.3 — Medium)\n- Affected Versions: `@strapi/upload` <=5.33.2\n- How to Patch: Immediately update your Strapi to >=5.33.3\n\n### Description of CVE-2026-22707\n\nIn Strapi versions prior to 5.33.3, the Upload plugin's Content API endpoints did not enforce the administrator-configured MIME type restrictions (`plugin.upload.security.allowedTypes` and `deniedTypes`). The same restrictions were correctly enforced on the Admin Panel upload path.\n\nThe upload plugin's `enforceUploadSecurity` security check was invoked in the admin upload controller but was missing from the Content API controller. The Content API handlers `uploadFiles` and `replaceFile` (and the `upload` wrapper that dispatches to them) called the underlying upload service directly, bypassing both the magic-byte MIME detection and the configured allow/deny lists.\n\nAn authenticated user with the Content API upload permission could therefore upload file types the administrator had explicitly disallowed, including HTML and SVG content. In deployments serving uploaded files from the same origin as the admin panel (default), an attacker could upload an HTML or SVG file that, when opened directly by an admin, executed JavaScript in the admin origin, enabling admin-session hijack and authenticated administrative actions against the admin API.\n\nThe patch introduces a shared `prepareUploadRequest` helper that wraps `enforceUploadSecurity` and is called from both the Content API and admin upload controllers, ensuring identical security policy enforcement on every upload entry point.\n\n### IoC's for CVE-2026-22707\n\nIndicators that an instance running an unpatched version may have been exploited:\n\n- Files in `/uploads/` with extensions outside the configured allow-list, particularly `.html`, `.htm`, `.svg`, `.js`, `.mjs`, `.xml`, or `.xhtml`. Filesystem regex: `\\.(html?|svg|m?js|x?html|xml)$`\n- Successful 201 responses from `POST /api/upload` where the uploaded file's MIME or extension is outside the configured `allowedTypes`\n- Server access logs showing non-administrator users uploading files with executable web content types. Content-Type regex: `text/html|application/javascript|image/svg\\+xml`\n- Admin browsing logs (X-Forwarded-For, User-Agent) opening files under `/uploads/*.html` or `/uploads/*.svg` shortly before unexpected administrative actions (user creation, role changes, permission modifications)\n\n## References\n\n- **CWE-693**: Protection Mechanism Failure\n- **CWE-434**: Unrestricted Upload of File with Dangerous Type\n- **OWASP**: Unrestricted File Upload\n- [Strapi 5 Documentation - Media Library](https://docs.strapi.io/cms/features/media-library)\n- [Strapi Security Policy](https://github.com/strapi/strapi/security/policy)\n\n## Credits\n\nReported independently by:\n- @kaminuma (initial report, 2026-01-09)\n- @arkmarta (concurrent report, 2026-01-13 — originally filed as GHSA-r7hp-523c-r8wr, closed as duplicate)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Strapi es un sistema de gestión de contenido headless de código abierto. En versiones de Strapi anteriores a la 5.33.3, los endpoints de la API de Contenido del plugin de Carga (Upload) no aplicaban las restricciones de tipo MIME configuradas por el administrador (’plugin.upload.security.allowedTypes’ y ’deniedTypes’). Las mismas restricciones se aplicaban correctamente en la ruta de carga del Panel de Administración. La verificación de seguridad ’enforceUploadSecurity’ del plugin de carga se invocaba en el controlador de carga de administración, pero faltaba en el controlador de la API de Contenido. Los manejadores de la API de Contenido ’uploadFiles’ y ’replaceFile’ (y el wrapper ’upload’ que los despacha) llamaban directamente al servicio de carga subyacente, omitiendo tanto la detección de MIME por magic-byte como las listas de permitidos/denegados configuradas. Un usuario autenticado con permiso de carga de la API de Contenido podía, por lo tanto, cargar tipos de archivo que el administrador había desautorizado explícitamente, incluyendo contenido HTML y SVG. En despliegues que servían archivos cargados desde el mismo origen que el panel de administración (por defecto), un atacante podía cargar un archivo HTML o SVG que, al ser abierto directamente por un administrador, ejecutaba JavaScript en el origen del administrador, permitiendo el secuestro de la sesión de administrador y acciones administrativas autenticadas contra la API de administración. El parche en la versión 5.33.3 introduce un ayudante compartido ’prepareUploadRequest’ que envuelve a ’enforceUploadSecurity’ y es llamado tanto desde la API de Contenido como desde los controladores de carga de administración, asegurando una aplicación idéntica de la política de seguridad en cada punto de entrada de carga.","source":"nvd"}],"published":"2026-05-14T13:12:56.000Z","modified":"2026-10-26T14:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-434","CWE-693"],"affected":[{"ranges":[{"version":"< 5.33.3","status":"affected"}],"vendor":"strapi","product":"strapi","source":"cvelist"},{"ranges":[{"version":"< 5.33.3","status":"affected"}],"vendor":"strapi","product":"@strapi/upload","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.33.3"}],"ecosystem":"npm","package":"@strapi/upload","purl":"pkg:npm/%40strapi/upload","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"5.33.3"}],"vendor":"strapi","product":"strapi","cpe":"cpe:2.3:a:strapi:strapi:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/strapi/strapi/security/advisories/GHSA-pcw7-5633-82vv","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22707","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/strapi/strapi","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-05-14T19:39:53.488Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22707","url":"https://www.cve.org/CVERecord?id=CVE-2026-22707","licence":"CVE Terms of Use","modified":"2026-05-14T19:40:11.102Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pcw7-5633-82vv","url":"https://github.com/advisories/GHSA-pcw7-5633-82vv","licence":"CC-BY-4.0","modified":"2026-05-16T00:05:04.490Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22707","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22707","licence":"Public domain","modified":"2026-10-26T14:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:21.743Z","epss":{"score":0.00195,"percentile":0.0971,"date":"2026-12-01T12:00:22.000Z"}}