/

CVE-2026-45019

Severity:

HIGH RISK

(7.2)

Server-Side Request Forgery (CWE-918) in Chainlit MCP Endpoint

CVE-2026-45019

Deferred

Vulnerability type

Category:

Server-Side Request Forgery

CWE:

CWE-918

Impact:

Unauthorized Internal and External Network Access

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Chainlit deployments with MCP enabled may expose an unauthenticated endpoint that accepts attacker-controlled destination URLs and request headers. This can cause the server to make outbound requests to internal services, cloud metadata endpoints, or external systems, including state-changing requests made with supplied credentials.

Affected context

The vulnerability occurs in Chainlit deployments where MCP is enabled through the application configuration and the MCP endpoint is reachable without authentication. The risk is highest when the server can access private network resources, cloud metadata services, or trusted APIs, and when outbound traffic is not restricted by network policy.

Exploit preconditions

  • Attack surface: The unauthenticated POST /mcp endpoint
  • Required access: Network access to the exposed Chainlit service; valid application authentication is not required for the affected endpoint
  • Trigger point: Processing an MCP connection request containing a user-controlled URL and optional headers
  • Why exploitation is possible: The server forwards the supplied destination and headers to outbound MCP client transports without sufficient scheme validation, private-address filtering, or destination allowlisting

Why this happens

The underlying issue is server-side request forgery caused by treating client-supplied connection targets as trusted outbound destinations. The MCP connection handler passes attacker-controlled URLs and headers to network client functions without enforcing safe schemes, blocking private or link-local addresses, or restricting destinations to an approved set. This behavior maps to CWE-918: Server-Side Request Forgery, because the server can be induced to make requests on behalf of an external user.

Potential impact

  • An attacker may discover internal services and scan reachable ports
  • The server could access cloud instance metadata or other restricted endpoints
  • Attacker-controlled headers may enable unauthorized requests to trusted services
  • State-changing actions could be performed against internal or external systems
  • Sensitive response effects or service behavior may be inferred even when response content is not returned
  • Network segmentation and trust boundaries could be weakened

General mitigation guidance

Mitigation generally focuses on reducing trust in client-supplied destinations and limiting the server's outbound network capabilities.

Common defensive patterns include:

  • Require authentication and authorization for MCP connection endpoints
  • Permit outbound connections only to explicitly approved destinations
  • Allow only required URL schemes and reject ambiguous or unsafe schemes
  • Block loopback, link-local, private, multicast, and reserved address ranges after DNS resolution
  • Restrict or remove user-controlled forwarding of Authorization, Cookie, and similar sensitive headers
  • Apply egress firewall rules and network policies around application workloads
  • Run the service with least-privilege network and cloud permissions
  • Use separate credentials and trust boundaries for outbound integrations

How teams detect issues like this

Detection approaches can include:

  • Static analysis for network client calls that consume request parameters without destination validation
  • Code review checks for URL sinks accepting user-controlled values
  • Rules identifying outbound forwarding of Authorization, Cookie, or other sensitive headers
  • API security tests for unauthenticated endpoints that initiate server-side connections
  • Runtime monitoring of outbound requests to private, link-local, metadata, or unexpected external addresses
  • Network policy alerts for unusual egress destinations, ports, or request methods
  • Automated security review tools that flag SSRF-prone URL handling and missing allowlists

Sources

SourceLink
github.comgithub.com/Chainlit/chainlit/blob/2.12.0/docs/security-advisory-2026-mcp.md#spl-2026-002--ssrf-via-mcp-streamable-http--sse
github.comgithub.com/Chainlit/chainlit/commit/0565fd0eccb915fce159929598b053ed79f6e0c9
github.comgithub.com/Chainlit/chainlit/releases/tag/2.12.0
github.comgithub.com/Chainlit/chainlit/security/advisories/GHSA-hvfh-5mj3-5f3j

Frequently asked

questions

Yes, when the MCP endpoint is reachable over the network and remains unauthenticated. The attacker generally does not need direct access to the Chainlit host or internal target.

The key requirement is network access to the exposed MCP endpoint. If deployment controls require authentication or restrict the endpoint to trusted clients, exploitability is reduced.

Require authentication and authorization, validate URLs against an explicit destination allowlist, block private and metadata address ranges, and enforce outbound network restrictions.

Treat all client-provided URLs and headers as untrusted, avoid forwarding sensitive headers by default, test egress behavior, and apply least-privilege network and cloud permissions.

Find out what's already
exploitable in your codebase.