# CVE-2026-45018: Chainlit command injection in MCP stdio transport

Source: https://junglewise.ai/threats/cve-2026-45018-chainlit-command-injection-in-mcp-stdio-transport  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-25. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-45018 · Severity: critical · CVSS 9.8 · Published 2026-08-25

Chainlit is a framework for building AI chat applications. When its Model Context Protocol (MCP) feature is enabled, an attacker can bypass command validation by injecting shell arguments into the stdio transport endpoint, achieving unauthenticated remote code execution with the privileges of the Chainlit process. Most deployments are unaffected because MCP is disabled by default.

Technologies: [Chainlit](https://junglewise.ai/threats/technologies/chainlit), [chainlit (PyPI)](https://junglewise.ai/threats/technologies/pypi-chainlit). Vendors: [Chainlit](https://junglewise.ai/threats/vendors/chainlit), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-45018 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-45018 being exploited in the wild.

**How severe is CVE-2026-45018?** Critical severity, with a CVSS score of 9.8, published 25 August 2026.

**Which products and versions are affected?** Chainlit >=2.4.0rc0, <2.12.0; chainlit (PyPI) ECOSYSTEM:introduced=2.4.0rc0,fixed=2.12.0.

**Is there a fix for CVE-2026-45018?** Yes. chainlit (PyPI): upgrade to 2.12.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-45018 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-45018?** Check whether you run Chainlit or chainlit (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- chainlit (PyPI): upgrade to 2.12.0 or later

  ```sh
  pip install "chainlit>=2.12.0"
  ```


## Technical details

The vulnerability is an OS command injection flaw in the `validate_mcp_command()` function in `backend/chainlit/mcp.py`. The function uses `shlex.split()` to parse a user-supplied `fullCommand` string and validates only the executable name (e.g., `npx`, `uvx`) against a configurable allowlist (`config.features.mcp.stdio.allowed_executables`), but returns arguments unchecked. These arguments are passed directly to `StdioServerParameters`, which spawns a subprocess. Since tools like `npx` support the `-c` flag for arbitrary shell execution, an attacker can craft a request like `npx -y -c 'id > /tmp/proof'` to pass the allowlist check while executing arbitrary commands. The `/mcp` endpoint is unconditionally registered on the FastAPI router in all Chainlit deployments; exploitation requires only an open session and `features.mcp.enabled = true`. A secondary issue exists in the Pydantic model where `allowed_executables` defaults to `None`, treated as "allow everything." The fix in v2.12.0 removes `fullCommand` from the client API entirely, moving command definition to developer-controlled configuration.

## Affected products

- Chainlit Chainlit >=2.4.0rc0, <2.12.0

## Identifiers

- CVE-2026-45018
- GHSA-w3fx-mc44-mf6j
- PYSEC-2026-3812

## Timeline

- 2026-08-25: disclosed
- 2026-08-25: patched: Version 2.12.0 released with fix removing fullCommand from client API

## References

- [https://api.github.com/users/dokterbob](https://api.github.com/users/dokterbob)
- [https://github.com/dokterbob](https://github.com/dokterbob)
- [https://api.github.com/users/dokterbob/gists%7B/gist_id%7D](https://api.github.com/users/dokterbob/gists%7B/gist_id%7D)
- [https://api.github.com/users/dokterbob/repos](https://api.github.com/users/dokterbob/repos)
- [https://avatars.githubusercontent.com/u/22742?v=4](https://avatars.githubusercontent.com/u/22742?v=4)
- [https://api.github.com/users/dokterbob/events%7B/privacy%7D](https://api.github.com/users/dokterbob/events%7B/privacy%7D)

## Related threats

- [Chainlit MCP path validation bypass via semicolon](https://junglewise.ai/threats/cve-2026-120492-chainlit-2-12-0-contains-a-server-side-request-forgery)
- [Chainlit path traversal and directory deletion via sessionId](https://junglewise.ai/threats/cve-2026-86099-chainlit-path-traversal-and-directory-deletion-via-sessionid)
- [Chainlit authorization bypass in feedback endpoints](https://junglewise.ai/threats/cve-2026-82290-chainlit-authorization-bypass-in-feedback-endpoints)
- [Chainlit server-side request forgery via MCP transports](https://junglewise.ai/threats/cve-2026-45019-chainlit-server-side-request-forgery-via-mcp-transports)
- [PYSEC-2026-1238 - Chainlit contains an authorization bypass vulnerability](https://junglewise.ai/threats/cve-2025-68492-chainlit-contains-an-authorization-bypass-vulnerability)
