medium CVSS 5.3 EPSS <0.1%

CVE-2026-40347·Python vulnerability

Python-Multipart is a streaming multipart parser for Python. Versions prior to 0.0.26 have a denial of service vulnerability when parsing crafted `multipart/form-data` requests with large preamble or epilogue sections. Upgrade to version 0.0.26 or later, which skips ahead to the next boundary candidate when processing leading CR/LF data and immediately discards epilogue data after the closing boundary.

Severity
medium
Software
Python
Fixed in
0.0.26
Published

How likely is exploitation

FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — higher than 14% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.

Affected versions

Until: 0.0.26

Fixed in: 0.0.26

How to fix this CVE

Update Python-Multipart to version 0.0.26 or later to resolve a denial-of-service vulnerability triggered by specially crafted multipart form data. Organizations using Python applications that process file uploads or form submissions should prioritize this update to prevent resource exhaustion attacks. The patch optimizes boundary parsing to prevent processing delays caused by oversized preamble or epilogue sections in multipart requests.

sudo dnf update python3-multipart || pip3 install --upgrade python-multipart>=0.0.26

Defensia detects this vulnerability

What an exploitation attempt looks like

Sample log line indicative of exploitation attempts:

POST.*multipart/form-data.*Content-Length:\s*\d{7,}|POST.*multipart/form-data.*boundary.*(?:\r?\n){50,}|multipart.*epilogue.*[A-Za-z0-9]{1000,}

WAF mitigation (if patching is not yet possible)

Add this rule to your WAF to block exploitation attempts while you schedule the patch.

Implement request size limits for multipart/form-data submissions (e.g., max 10MB). Configure WAF rules to reject requests where the Content-Length header for multipart payloads exceeds typical thresholds or contains excessive CR/LF sequences before the first boundary marker.

How to check if you are affected

  1. Run `pip3 show python-multipart | grep Version` to retrieve the installed version of the python-multipart library
  2. Check if your application imports multipart or uses frameworks like FastAPI, Django, or Starlette that depend on this library via `grep -r 'from multipart\|import multipart' /path/to/app`
  3. Search application logs for HTTP requests with large Content-Length values in multipart/form-data headers: `grep -i 'multipart/form-data' /var/log/app.log | grep -E 'Content-Length: [0-9]{7,}'`
  4. Verify the patch by running `pip3 show python-multipart` again and confirming the version is 0.0.26 or higher

FAQ

What is CVE-2026-40347?

CVE-2026-40347 is a denial-of-service vulnerability in Python-Multipart versions before 0.0.26 where maliciously crafted multipart form requests with abnormally large preamble or epilogue data can cause the parser to consume excessive resources, leading to application unavailability.

Is CVE-2026-40347 being actively exploited?

No, CVE-2026-40347 is not currently listed on the CISA Known Exploited Vulnerabilities catalog, and no public exploit code is available.

What versions of Python-Multipart are affected by CVE-2026-40347?

All versions prior to 0.0.26 are affected. Version 0.0.26 and later contain the necessary protections.

How do I check if my server is vulnerable to CVE-2026-40347?

Run `pip3 list | grep python-multipart` to see the installed version. If the version is below 0.0.26, your system is vulnerable.

Does Defensia detect CVE-2026-40347?

Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Python-Multipart is installed on a monitored server, CVE-2026-40347 will appear in your dashboard with remediation steps.

Related Python CVEs

CVE-2026-25632CVSS 10EPyT-Flow is a Python package designed for the easy generation of hydraulic and water quality scenario data of water distribution networks. Prior to 0.16.1, EPyT-Flow’s REST API parses attacker-controlled JSON request bodies using a custom deserializer (my_load_from_json) that supports a type field. When type is present, the deserializer dynamically imports an attacker-specified module/class and instantiates it with attacker-supplied arguments. This allows invoking dangerous classes such as subprocess.Popen, which can lead to OS command execution during JSON parsing. This also affects the loading of JSON files. This vulnerability is fixed in 0.16.1.
CVE-2026-34938CVSS 10PraisonAI is a multi-agent teams system. Prior to version 1.5.90, execute_code() in praisonai-agents runs attacker-controlled Python inside a three-layer sandbox that can be fully bypassed by passing a str subclass with an overridden startswith() method to the _safe_getattr wrapper, achieving arbitrary OS command execution on the host. This issue has been patched in version 1.5.90.
CVE-2026-33054CVSS 10Mesop is a Python-based UI framework that allows users to build web applications. Versions 1.2.2 and below contain a Path Traversal vulnerability that allows any user supplying an untrusted state_token through the UI stream payload to arbitrarily target files on the disk under the standard file-based runtime backend. This can result in application denial of service (via crash loops when reading non-msgpack target files as configurations), or arbitrary file manipulation. This vulnerability heavily exposes systems hosted utilizing FileStateSessionBackend. Unauthorized malicious actors could interact with arbitrary payloads overwriting or explicitly removing underlying service resources natively outside the application bounds. This issue has been fixed in version 1.2.3.
CVE-2026-28505CVSS 10Tautulli is a Python based monitoring and tracking tool for Plex Media Server. Prior to version 2.17.0, the str_eval() function in notification_handler.py implements a sandboxed eval() for notification text templates. The sandbox attempts to restrict callable names by inspecting code.co_names of the compiled code object. However, co_names only contains names from the outer code object. When a lambda expression is used, it creates a nested code object whose attribute accesses are stored in code.co_consts, NOT in code.co_names. The sandbox never inspects nested code objects. This issue has been patched in version 2.17.0.
CVE-2026-33873CVSS 9.9Langflow is a tool for building and deploying AI-powered agents and workflows. Prior to version 1.9.0, the Agentic Assistant feature in Langflow executes LLM-generated Python code during its validation phase. Although this phase appears intended to validate generated component code, the implementation reaches dynamic execution sinks and instantiates the generated class server-side. In deployments where an attacker can access the Agentic Assistant feature and influence the model output, this can result in arbitrary server-side Python execution. Version 1.9.0 fixes the issue.

References

Track CVEs across your fleet automatically

Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-40347. Free for 1 server.

Get started free