Command Injection Affecting chainlit package, versions [2.4.0rc0, 2.12.0)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.65% (49th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-CHAINLIT-19268250
  • published26 Aug 2026
  • disclosed25 Aug 2026
  • creditqvipin, ladderlogix

Introduced: 25 Aug 2026

NewCVE-2026-45018  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade chainlit to version 2.12.0 or higher.

Overview

chainlit is a Build Conversational AI.

Affected versions of this package are vulnerable to Command Injection through the validate_mcp_command() flow in backend/chainlit/mcp.py and the /mcp stdio connect handler. An attacker can execute arbitrary OS commands on the server by sending a POST /mcp request with a crafted fullCommand such as npx -y -c 'PAYLOAD'. When features.mcp.enabled = true, the injected command runs with the privileges of the Chainlit process before the MCP handshake completes, enabling remote code execution and full host compromise.

Workarounds

  • Set features.mcp.enabled = false in .chainlit/config.toml to disable /mcp entirely and block the unauthenticated command-injection path.
  • Register an authentication callback so /mcp requires an authenticated session, which removes the unauthenticated attack path.

CVSS Base Scores

version 4.0
version 3.1