CVE-2026-45018 Chainlit: Command injection via MCP stdio transport allows unauthenticated remote code execution
Unauthenticated attackers can execute arbitrary shell commands via the MCP stdio endpoint if MCP features are enabled, leading to remote code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-45018?
CVE-2026-45018 is a critical command injection vulnerability in chainlit, published on 25 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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 stdio transport, the endpoint accepts a user-controlled fullCommand string. The validate_mcp_command() function in backend/chainlit/mcp.py checks only the executable name against config.features.mcp.stdio.allowed_executables and passes unchecked arguments to StdioServerParameters in backend/chainlit/server.py. Because npx supports the -c argument, an attacker can execute arbitrary shell commands with the privileges of the Chainlit process. If allowed_executables is unset, its None default is treated as allowing every executable. This issue is fixed in version 2.12.0.
Weakness: CWE-78
Which versions are affected by CVE-2026-45018?
3 open source packages ship an affected version, including chainlit.
| Package | Affected | Fixed in |
|---|---|---|
chainlit PyPI | From 2.4.0rc0 | 2.12.0 |
chainlit PyPI | From 2.4.0rc0 | 2.12.0 |
chainlit PyPI | From 2.4.0rc0 | 2.12.0 |
How do I fix CVE-2026-45018?
Upgrade chainlit to 2.12.0 or later.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2026-45018 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-45018 exists.
Sources
Also known as GHSA-w3fx-mc44-mf6j, PYSEC-2026-3812.