CVE/vulnerability

Critical Chainlit AI Flaws Let Hackers Seize Control Of Cloud Environments

Zafran Labs uncovered two critical vulnerabilities in Chainlit, a popular open-source framework for building conversational AI apps.

Chainlit powers internet-facing AI systems in enterprises across industries, averaging 700,000 PyPI downloads monthly.

The flaws CVE-2026-22218 (arbitrary file read) and CVE-2026-22219 (SSRF) enable attackers to steal API keys, sensitive files, and cloud credentials without user interaction.

Zafran confirmed exploitation on real-world servers from major firms, launching Project DarkSide to probe AI infrastructure risks.

These issues hit Chainlit’s core: its UI/frontend layer for user chats and backend for AI orchestration with tools like LangChain, OpenAI, and AWS Bedrock.

Chainlit AI Flaws Hijack Clouds

Attackers authenticate, then exploit the /project/element PUT endpoint. Chainlit’s Element class mishandles custom elements, copying server files or fetching remote URLs blindly.

Technical Breakdown and Exploitation

CVE-2026-22218: Arbitrary File Read

Attackers send a custom element with a controlled path property. Chainlit’s persist_file copies any server-readable file to the attacker’s session directory, exposed via API.

Targets include /proc/self/environ for env vars like AWS_SECRET_KEY, CHAINLIT_AUTH_SECRET (for token forgery), and .chainlit/.langchain.db (leaking cross-tenant prompts in LangChain setups).

Source code like app.py reveals custom hooks; SQLite DBs dump user chats.

CVE-2026-22219: SSRF

In SQLAlchemy data layers, set url in a custom element. Chainlit fetches it via aiohttp, storing content for exfiltration via generated read URLs. Pairs with file read to probe internal services from leaked env vars or /etc/hosts.

On AWS EC2 with IMDSv1, hit http://169.254.169.254/latest/meta-data/iam/security-credentials/ for role creds, enabling lateral movement to buckets, secrets, and LLMs.

The chain starts with an auth bypass via forged tokens, escalates to cloud takeover. No privileges needed beyond session access.

Multi-tenant setups amplify risks, leaking all users’ LLM prompts/responses.

CVECVSS (est.)TypeAffected EndpointKey Targets
CVE-2026-222189.1 (Critical)Arbitrary File ReadPUT /project/element (path prop)/proc/self/environ, .langchain.db, app.py
CVE-2026-222198.8 (High)SSRFPUT /project/element (url prop)Internal APIs, 169.254.169.254 (IMDSv1)

IoCs

  • Exposed Chainlit servers: Scan for /chainlit paths or WebSocket /ws on ports 8000/3000.
  • Vuln versions: <2.9.4 (check headers/User-Agent for “Chainlit”).
  • Traffic: PUT /project/element with {"type":"custom","path":"..."} or {"type":"custom","url":"..."}.
  • Files: .chainlit/.langchain.db, env leaks containing CHAINLIT_AUTH_SECRET.
  • Zafran Snort sig: alert tcp $EXTERNAL_NET any -> $HTTP_SERVERS $HTTP_PORTS (msg:"Chainleak - PUT /project/element"; content:"PUT"; http_method; content:"/project/element"; http_uri; depth:16;)
Chainlit AI Flaws Hijack Clouds

Mitigations

Upgrade to Chainlit 2.9.4 immediately. Use Zafran’s Components module or WAF rules. Block IMDSv1; enforce least-privilege IAM. Scan for exposed instances via Shodan/Censys.

Project DarkSide exposes AI stack risks, UI, agents, orchestration, and LLMs, where classic flaws chain into cloud breaches. As AI adoption surges, secure frameworks like Chainlit to block “dark side” attacks.

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Varshini

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

1 day ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

1 day ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

1 day ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

1 day ago