VAITP Dataset

← Back to the dataset

CVE-2026-45019

MCP endpoint permits SSRF with attacker‑controlled URL and headers.

  • CVSS 7.2
  • CWE-918
  • Input Validation and Sanitization
  • Remote

Chainlit is a Python framework for building production-ready conversational AI applications. From 2.4.0rc0 until 2.12.0, Chainlit deployments with features.mcp.enabled set to true in .chainlit/config.toml expose the POST /mcp endpoint without requiring authentication. For sse and streamable-http transports, ConnectSseMCPRequest and ConnectStreamableHttpMCPRequest in backend/chainlit/types.py accept a user-controlled url and optional headers dictionary without scheme validation, private-address filtering, or an allowlist. The connect_mcp handler in backend/chainlit/server.py passes these values to sse_client() or streamablehttp_client(), allowing the Chainlit server to make blind outbound requests to arbitrary internal or external services, including cloud metadata endpoints, with attacker-controlled Authorization and Cookie headers. The SSE URL sink has existed since 2.4.0rc0, while attacker-controlled header forwarding and streamable-http support were added in 2.6.4. The response is consumed internally and not returned, but the attacker can issue state-changing authenticated requests, discover internal services, scan ports, and probe metadata endpoints. This issue is fixed in version 2.12.0.

CVSS base score
7.2
Published
2026-08-25
OWASP
A10 Server-Side Request Forgery (SSRF)
Orthogonal defect classification
Interface
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Insecure Direct Object References (IDOR)
Accessibility scope
Remote
Impact
Unauthorized Access
Affected component
Python
Fixed by upgrading
Yes

Solution

Upgrade Chainlit to version 2.12.0 or later.

Vulnerable code sample

import urllib.parse
from typing import Dict, Any

def connect_mcp(url: str, headers: Dict[str, str] | None = None) -> Any:
    # VULNERABLE: unchecked user‑controlled URL passed to outbound client
    return sse_client(url, headers or {})

def sse_client(target_url: str, hdrs: Dict[str, str]) -> str:
    # Placeholder for the actual SSE client implementation
    return f"Fetched from {target_url} with {hdrs}"

Patched code sample

import urllib.parse
import ipaddress
from typing import Dict, Any

ALLOWED_HOSTS = {"api.trusted.com", "services.example.org"}

def connect_mcp(url: str, headers: Dict[str, str] | None = None) -> Any:
    # FIX: validate scheme, block private IPs, and restrict to allowlist
    parsed = urllib.parse.urlparse(url)
    if parsed.scheme not in ("http", "https"):
        raise ValueError("Unsupported URL scheme")
    host = parsed.hostname
    if not host:
        raise ValueError("Missing hostname")
    # Block private/reserved IPs
    try:
        ip = ipaddress.ip_address(host)
        if ip.is_private or ip.is_loopback or ip.is_reserved:
            raise ValueError("Disallowed IP address")
    except ValueError:
        # host is a domain name; resolve later
        pass
    if host not in ALLOWED_HOSTS:
        raise ValueError("Host not in allowlist")
    return sse_client(url, headers or {})

def sse_client(target_url: str, hdrs: Dict[str, str]) -> str:
    # Placeholder for the actual SSE client implementation
    return f"Fetched from {target_url} with {hdrs}"

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • Merge commit from fork (Chainlit/chainlit)
    backend/chainlit/config.py, backend/chainlit/config.py · load_settings, backend/chainlit/mcp.py, backend/chainlit/server.py, backend/chainlit/server.py · connect_mcp, backend/chainlit/server.py · project_settings, backend/chainlit/session.py, backend/chainlit/session.py · McpSession.close, backend/chainlit/types.py, backend/chainlit/version.py, cypress/e2e/config_overrides/main.py, cypress/e2e/config_overrides/main.py · chat_profile

Cite this entry

@misc{vaitp:cve202645019,
  title        = {{MCP endpoint permits SSRF with attacker‑controlled URL and headers.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-45019},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-45019/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.