django-mdeditor CVE-2025-13030
HIGHCVSS VectorNVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L/E:P
Lifecycle Timeline
2DescriptionNVD
All versions of the package django-mdeditor are vulnerable to Missing Authentication for Critical Function in the image upload endpoint. An attacker can upload malicious files and achieve arbitrary code execution since this endpoint lacks authentication protection and proper sanitisation of file names.
AnalysisAI
Remote code execution in django-mdeditor (all versions prior to commit 3e80f9e) allows unauthenticated attackers to upload malicious files via the image upload endpoint. The vulnerability combines missing authentication (CWE-306) with insufficient filename sanitization, enabling arbitrary code execution when uploaded files are accessed. Exploit code is publicly available (CVSS E:P), though user interaction is required (UI:R). EPSS data not available, not listed in CISA KEV at time of analysis.
Technical ContextAI
django-mdeditor is a Python package providing a Markdown editor widget for Django web applications. The vulnerability exists in the UploadImageView class (mdeditor/views.py line 25) which handles image uploads for the editor. The endpoint is exposed without Django's standard authentication decorators or middleware checks, and accepts file uploads without validating file content beyond extension checking. The CVSS vector indicates network-based attack (AV:N) with low complexity (AC:L) requiring no privileges (PR:N), classified under CWE-306 (Missing Authentication for Critical Function). The code uses Django's file upload handling but lacks both authentication guards and robust file type validation using magic bytes or image library verification, allowing attackers to upload executable files (e.g., Python .py files, server-side scripts) disguised with image extensions.
RemediationAI
Update django-mdeditor to a version incorporating commit 3e80f9edcabc5d2fc136b05a501964b8a5e97cfe or later from https://github.com/pylixm/django-mdeditor. The patch introduces two protections: optional authentication requirement via upload_require_auth configuration flag (defaults to False for backward compatibility) and Pillow-based image validation to verify uploaded files are legitimate images. Enable authentication by adding 'upload_require_auth': True to MDEDITOR_CONFIGS in Django settings.py, which restricts uploads to authenticated users only. If immediate patching is not feasible, implement compensating controls: restrict access to the /mdeditor/upload endpoint using Django middleware or web server ACLs to authenticated users only; configure file upload directory outside the web root with no execute permissions; implement Content-Security-Policy headers to prevent uploaded script execution; or disable the mdeditor upload functionality entirely and use external image hosting. Note that enabling upload_require_auth changes application behavior and may break workflows expecting anonymous uploads. Vendor advisory available at https://security.snyk.io/vuln/SNYK-PYTHON-DJANGOMDEDITOR-8630926.
Share
External POC / Exploit Code
Leaving vuln.today