{"id":"CVE-2026-27641","aliases":["GHSA-65mp-fq8v-56jr","PYSEC-2026-341"],"title":"Flask-Reuploaded vulnerable to Remote Code Execution via Server-Side Template Injection","summary":"Flask-Reuploaded vulnerable to Remote Code Execution via Server-Side Template Injection","severity":"critical","cvss":9.8,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","vendor":"flask-reuploaded","product":"flask-reuploaded","ecosystem":"pip","affected":["flask-reuploaded < 1.5.0"],"patched":["flask-reuploaded 1.5.0"],"published":"2026-02-25","updated":"2026-10-27","sourceUpdated":"2026-10-27T17:00:03.992051129Z","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-65mp-fq8v-56jr","references":[{"url":"https://github.com/jugmac00/flask-reuploaded/security/advisories/GHSA-65mp-fq8v-56jr"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27641"},{"url":"https://github.com/jugmac00/flask-reuploaded/pull/180"},{"url":"https://github.com/jugmac00/flask-reuploaded/commit/d64c6b2f71cb73734fc38baa0e3e156926361288"},{"url":"https://github.com/jugmac00/flask-reuploaded"},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/flask-reuploaded/PYSEC-2026-341.yaml"},{"url":"https://pypi.org/project/flask-reuploaded"},{"url":"https://github.com/advisories/GHSA-65mp-fq8v-56jr"}],"tags":["osv","pip","exploit-available","ghsa"],"epss":0.01337,"epssPercentile":0.71066,"exploits":{"github":1,"githubRepos":["https://github.com/Max78000/CVE-2026-27641-Flask-Reuploaded"],"checkedAt":"2026-10-27T18:16:08.386Z"},"exploitAvailable":true,"cwe":["CWE-22","CWE-1336"],"ingestedAt":"2026-10-27T17:33:23.776Z","slug":"CVE-2026-27641","body":"## Overview\n\n### 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.\n\n## Affected packages\n\n- `flask-reuploaded < 1.5.0`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `flask-reuploaded 1.5.0`","depth":"abyssal","depthScore":66,"depthScoreParts":{"impact":53.9,"likelihood":0.3,"exploitation":12,"ransomware":0},"changes":[]}