Summary
CVE-2026-45018 is a critical OS command injection vulnerability (CWE-78) in Chainlit, a Python framework for building conversational AI applications. When the Model Context Protocol (MCP) feature is enabled, an unauthenticated attacker can send a crafted request to the POST /mcp endpoint to execute arbitrary shell commands with the privileges of the Chainlit process. The flaw carries a CVSS v3.1 base score of 9.8 (Critical) and requires no authentication or user interaction.
Technical details
- Root cause: the
validate_mcp_command()function (inbackend/chainlit/mcp.py) checks only the executable name in a user-suppliedfullCommandstring againstconfig.features.mcp.stdio.allowed_executables, then passes the remaining arguments unchecked toStdioServerParameters. - Additional flaw: if
allowed_executablesis left unset, its default value ofNoneis treated as permitting every executable rather than none. - Trigger conditions: the deployment must have
features.mcp.enabled = truein.chainlit/config.toml, and the attacker uses the stdio transport by submitting a command such as an allowed executable (e.g.,npx) combined with argument flags (e.g.,-c) that execute arbitrary shell commands. - Attack vector: network, unauthenticated, no user interaction — the
/mcpendpoint does not require prior authentication. - Impact: full remote code execution with the privileges of the Chainlit server process, resulting in complete loss of confidentiality, integrity, and availability of the host.
Affected software
- Chainlit (PyPI package
chainlit), versions>= 2.4.0rc0and< 2.12.0. - Note: MCP support has been disabled by default since Chainlit 2.7.0, which limits exposure to deployments that explicitly enabled
features.mcp.enabled.
Severity
- CVSS v3.1 Base Score: 9.8 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: upgrade Chainlit to version 2.12.0 or later, which fixes the argument validation logic.
- If immediate upgrade is not possible:
- Set
features.mcp.enabled = falsein.chainlit/config.tomlto disable the vulnerable MCP stdio endpoint entirely. - Explicitly restrict
config.features.mcp.stdio.allowed_executablesto a minimal, vetted list rather than leaving it unset. - Restrict or sandbox the host’s ability to spawn outbound processes from the Chainlit service.
- Place an authentication requirement (e.g., an auth callback) in front of the application to reduce unauthenticated exposure.
[{"name": "CVE-2026-45018 Record (CVE List)", "url": "https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/45xxx/CVE-2026-45018.json"}, {"name": "Chainlit Security Advisory GHSA-w3fx-mc44-mf6j", "url": "https://github.com/Chainlit/chainlit/security/advisories/GHSA-w3fx-mc44-mf6j"}, {"name": "Chainlit 2.12.0 Release Notes", "url": "https://github.com/Chainlit/chainlit/releases/tag/2.12.0"}]
- Set

