{"id":"CVE-2026-27641","aliases":["CVE-2026-27641","GHSA-65mp-fq8v-56jr","PYSEC-2026-341"],"related":[],"kind":"vulnerability","state":"published","title":"Flask-Reuploaded vulnerable to Remote Code Execution via Server-Side Template Injection","summary":"Flask-Reuploaded provides file uploads for Flask. A critical path traversal and extension bypass vulnerability in versions prior to 1.5.0 allows remote attackers to achieve arbitrary file write and remote code execution through Server-Side Template Injection (SSTI). Flask-Reuploaded has been patched in version 1.5.0. Some workarounds are available. Do not pass user input to the `name` parameter, use auto-generated filenames only, and implement strict input validation if `name` must be used.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Flask-Reuploaded provides file uploads for Flask. A critical path traversal and extension bypass vulnerability in versions prior to 1.5.0 allows remote attackers to achieve arbitrary file write and remote code execution through Server-Side Template Injection (SSTI). Flask-Reuploaded has been patched in version 1.5.0. Some workarounds are available. Do not pass user input to the `name` parameter, use auto-generated filenames only, and implement strict input validation if `name` must be used.","source":"cvelist"},{"lang":"en","text":"### Impact\nA critical path traversal and extension bypass vulnerability in Flask-Reuploaded allows remote attackers to achieve arbitrary file write and remote code execution through Server-Side Template Injection (SSTI).\n\n### Patches\nFlask-Reuploaded has been patched in version 1.5.0\n\n### Workarounds\n\n1. **Do not pass user input to the `name` parameter**\n2. Use auto-generated filenames only\n3. Implement strict input validation if `name` must be used\n\n```python\nfrom werkzeug.utils import secure_filename\nimport os\n\n# Sanitize user input before passing to save()\nsafe_name = secure_filename(request.form.get('custom_name'))\n# Remove path separators\nsafe_name = os.path.basename(safe_name)\n# Validate extension matches policy\nif not photos.extension_allowed(photos.get_extension(safe_name)):\n    abort(400)\n    \nfilename = photos.save(file, name=safe_name)\n```\n\n### Resources\nThe fix is documented in the pull request, see https://github.com/jugmac00/flask-reuploaded/pull/180.\n\nA proper write-up was created by the reporter of the vulnerability, Jaron Cabral (https://www.linkedin.com/in/jaron-cabral-751994357/), but is not yet available as of time of this publication.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Flask-Reuploaded proporciona carga de archivos para Flask. Una vulnerabilidad crítica de salto de ruta y omisión de extensión en versiones anteriores a la 1.5.0 permite a atacantes remotos lograr escritura arbitraria de archivos y ejecución remota de código a través de Inyección de Plantillas del Lado del Servidor (SSTI). Flask-Reuploaded ha sido parcheado en la versión 1.5.0. Hay disponibles algunas soluciones alternativas. No pase entradas de usuario al parámetro 'name', use solo nombres de archivo autogenerados, e implemente una estricta validación de entrada si se tiene que usar 'name'.","source":"nvd"}],"published":"2026-02-25T03:54:54.391Z","modified":"2026-10-27T17:00:03.992Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-22","CWE-1336"],"affected":[{"ranges":[{"version":"< 1.5.0","status":"affected"}],"vendor":"jugmac00","product":"flask-reuploaded","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.5.0"}],"ecosystem":"PyPI","package":"flask-reuploaded","purl":"pkg:pypi/flask-reuploaded","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.5.0"}],"vendor":"jugmac00","product":"flask-reuploaded","cpe":"cpe:2.3:a:jugmac00:flask-reuploaded:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.5.0"}],"ecosystem":"PyPI","package":"flask-reuploaded","purl":"pkg:pypi/flask-reuploaded","source":"pysec"}],"references":[{"url":"https://github.com/jugmac00/flask-reuploaded/security/advisories/GHSA-65mp-fq8v-56jr","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/jugmac00/flask-reuploaded/pull/180","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/jugmac00/flask-reuploaded/commit/d64c6b2f71cb73734fc38baa0e3e156926361288","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27641","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/jugmac00/flask-reuploaded","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/flask-reuploaded/PYSEC-2026-341.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://pypi.org/project/flask-reuploaded","tags":["package","web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/advisories/GHSA-65mp-fq8v-56jr","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-02-25T21:12:32.024Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-27641","url":"https://www.cve.org/CVERecord?id=CVE-2026-27641","licence":"CVE Terms of Use","modified":"2026-02-25T21:12:45.608Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-65mp-fq8v-56jr","url":"https://github.com/advisories/GHSA-65mp-fq8v-56jr","licence":"CC-BY-4.0","modified":"2026-10-27T17:00:03.992Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-27641","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27641","licence":"Public domain","modified":"2026-06-17T10:27:26.560Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-341","url":"https://osv.dev/vulnerability/PYSEC-2026-341","licence":"CC-BY-4.0","modified":"2026-07-01T20:22:53.047Z"}],"updatedAt":"2026-11-25T22:59:14.818Z","epss":{"score":0.01317,"percentile":0.71666,"date":"2026-12-02T12:00:21.000Z"}}