/

CVE-2026-86099

Severity:

HIGH RISK

(8.2)

Path Traversal (CWE-22) in Chainlit Socket.IO Handler

CVE-2026-86099

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File and Directory Deletion

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Chainlit does not adequately validate a client-supplied Socket.IO session identifier, allowing unauthenticated attackers to use absolute or relative path sequences to escape the intended upload directory. A crafted sessionId may cause the service to recursively delete directories accessible to the process.

Affected context

The vulnerability occurs in Chainlit deployments that process client-controlled Socket.IO sessionId values and use those values to derive filesystem paths. It becomes risky when path components are not constrained to an intended upload directory and the service process has write or delete permissions beyond that location.

Exploit preconditions

  • Attack surface: Socket.IO session handling and related filesystem operations
  • Required access: No authentication is generally required; the attacker must be able to connect to the exposed service
  • Trigger point: Processing a malicious client-supplied sessionId
  • Why exploitation is possible: Insufficient canonicalization and containment checks allow absolute paths or traversal sequences to resolve outside the permitted upload directory
  • Effective scope: Deletion is limited by the filesystem permissions of the Chainlit service process

Why this happens

The underlying bug is improper limitation of a user-controlled path, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory. The application uses a client-supplied identifier in filesystem path construction without reliably canonicalizing the result and verifying that it remains within an approved directory. As a result, path traversal sequences or absolute paths can redirect file operations to unintended locations.

Potential impact

  • An attacker may delete uploaded files and application data
  • An attacker could recursively remove directories accessible to the service account
  • The service may experience denial of service or loss of functionality
  • Application state, logs, or other locally accessible data may be destroyed
  • Data integrity and recovery operations can be affected

General mitigation guidance

Mitigation generally focuses on removing client control over filesystem

locations and enforcing directory containment.

Common defensive patterns include:

  • Treating session identifiers as opaque, server-generated values rather than filesystem paths
  • Applying strict allowlists for identifier syntax and length
  • Canonicalizing paths and verifying that resolved targets remain below a fixed, intended directory
  • Rejecting absolute paths, traversal segments, symlinks, and unexpected path separators where appropriate
  • Separating upload storage from sensitive application and system directories
  • Running the service with the least filesystem privileges required
  • Using non-destructive, narrowly scoped cleanup routines with explicit ownership checks
  • Applying filesystem isolation and read-only controls where feasible

How teams detect issues like this

Detection can combine code analysis, runtime monitoring, and policy enforcement.

  • Static analysis can flag user-controlled values passed to path-joining, recursive deletion, file removal, or directory traversal APIs
  • Code review should examine whether canonicalized paths are checked against an approved base directory before file operations
  • Tests should cover absolute paths, traversal sequences, alternate separators, symlinks, and encoded input
  • Runtime monitoring can alert on unexpected recursive deletion or access outside designated upload locations
  • Service policies can restrict filesystem permissions and deny access to unrelated directories
  • Automated security review tools may help identify unsafe path construction and deletion patterns

Sources

SourceLink
github.comgithub.com/Chainlit/chainlit
github.comgithub.com/Chainlit/chainlit/blob/2.12.0/backend/chainlit/session.py
github.comgithub.com/Chainlit/chainlit/blob/2.12.0/backend/chainlit/socket.py
pypi.orgpypi.org/project/chainlit/
vulncheck.comvulncheck.com/advisories/chainlit-through-2.12.0-path-traversal-via-socket-io-sessionid

Frequently asked

questions

Yes. An unauthenticated attacker may exploit the issue through the exposed

Socket.IO service by submitting a crafted sessionId, subject to network

reachability and deployment controls.

The attacker generally needs only the ability to connect to the relevant

Chainlit endpoint. The extent of deletion depends on the filesystem

permissions granted to the Chainlit process.

Do not derive filesystem locations directly from client-controlled session

identifiers. Use server-generated opaque identifiers, enforce canonical

directory containment, and limit cleanup operations to owned storage.

Apply strict input validation, test path-handling edge cases, run services with

least privilege, and monitor filesystem operations for access outside approved

directories.

Find out what's already
exploitable in your codebase.