/

CVE-2026-33054

Severity:

CRITICAL RISK

(10.0)

Path Traversal in Mesop FileStateSessionBackend

CVE-2026-33054

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Access and Manipulation leading to Denial of Service

Severity:

CRITICAL RISK

(10.0)

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

Mesop versions 1.2.2 and below contain a path traversal vulnerability in the file-based runtime backend that allows untrusted state_token values from UI stream payloads to target arbitrary files on disk.

Under the FileStateSessionBackend, an attacker can abuse crafted tokens to cause denial of service through crash loops or manipulate and delete backend files outside normal application bounds.

Affected context

This vulnerability occurs in deployments of Mesop that use the standard file-based runtime backend, specifically the FileStateSessionBackend for storing UI state and session data.

The issue manifests when state_token values supplied via UI stream payloads are used to construct filesystem paths without sufficiently constraining or normalizing the resulting path.

Systems that expose Mesop applications to untrusted or semi-trusted users, such as public-facing web apps or multi-tenant dashboards, are particularly at risk because any such user can supply arbitrary tokens.

Exploit preconditions

  • Attack surface: HTTP/UI stream interface where clients can submit or influence state_token values as part of the payload.
  • Required access: Ability to interact with the Mesop web application (no direct filesystem or shell access required); in many deployments this means any remote user with network access to the app.
  • Trigger point: Backend logic that maps the state_token to a file path on disk and then reads, writes, or deletes the correlated file for session or configuration handling.
  • Why exploitation is possible: The backend treats state_token as a trusted filesystem identifier without restricting it to a safe directory, validating allowed patterns, or preventing directory traversal sequences (e.g., ../) and other crafted path components.

Why this happens

The underlying bug is a classic path traversal problem where untrusted input is used to build filesystem paths that the application then operates on.

Instead of constraining file operations to a fixed directory and a controlled filename schema, the FileStateSessionBackend uses user-influenced state_token values directly or with insufficient normalization, enabling the computed path to escape the intended storage directory.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where the absence of robust canonicalization and validation allows attackers to reach or manipulate files outside the authorized scope.

Potential impact

  • Application denial of service by forcing repeated attempts to parse non-msgpack files as configuration or state, leading to crash loops or persistent failures.
  • Overwriting of critical state or configuration files used by the backend, potentially altering application behavior or corrupting session data.
  • Deletion of files relied upon by the service, causing data loss or unexpected runtime errors.
  • Manipulation of files that, while outside the intended application storage directory, are reachable by the process and can be targeted by the constructed paths.
  • Escalation of impact in multi-tenant environments, where one tenant can interfere with another tenant's state or resources stored on disk.

General mitigation guidance

Effective mitigation focuses on strictly confining file operations derived from user input and treating all external identifiers as untrusted.

Recommended defensive patterns include:

  • Directory confinement: Ensure all paths derived from state_token are resolved against a fixed, application-controlled root directory, rejecting any path that escapes this root after canonicalization.
  • Input validation and normalization: Enforce a strict, documented format for state_token (e.g., UUIDs or opaque tokens) and disallow path separators, traversal sequences, or any characters not explicitly required.
  • Use of indirect identifiers: Store state using generated, opaque IDs that map to files via a server-side lookup table rather than deriving filenames directly from client-provided values.
  • Least-privilege filesystem access: Run the Mesop process under an account with access only to the directories it genuinely needs, reducing the blast radius if traversal is attempted.
  • Robust error handling: Handle file parsing and read errors gracefully to prevent crash loops, converting unexpected file formats into controlled failures instead of repeated restart cycles.

How teams detect issues like this

Organizations can detect and monitor for this class of issue using a combination of static and dynamic approaches:

  • Static analysis: Configure rules or linters to flag string concatenation or interpolation operations that combine user-sourced values (like state_token) with filesystem paths, especially when used in open/read/write/delete calls.
  • Code review heuristics: During reviews, scrutinize any code that:
  • Builds paths from request parameters or UI payloads,
  • Accesses session/state files,
  • Performs file operations without explicit whitelisting or canonicalization.
  • Runtime logging and monitoring: Log resolved file paths and unexpected file access errors in the backend, and alert on patterns such as ../ in tokens or repeated attempts to access non-existent or invalid files.
  • Policy enforcement: Integrate security checks into CI/CD pipelines to enforce safe file-access patterns, including mandatory use of helper APIs that encapsulate path canonicalization and directory confinement.

Sources

SourceLink
github.comgithub.com/mesop-dev/mesop/commit/c6b382f363b73ac32c402a2db3aadc7784f66a5b
github.comgithub.com/mesop-dev/mesop/releases/tag/v1.2.3
github.comgithub.com/mesop-dev/mesop/security/advisories/GHSA-8qvf-mr4w-9x2c

Frequently asked

questions

It is remotely exploitable in typical Mesop deployments. Any user who can reach the Mesop web application and submit UI stream payloads containing a state_token can attempt to exploit the issue; no local filesystem or shell access is required.

The attacker only needs the ability to interact with the application over the network, such as a standard web client session. They do not need authentication in configurations where the UI endpoint is publicly exposed, although access controls can limit who can send crafted payloads.

The safest approach is to stop using raw user-supplied values as filesystem paths. Instead, confine file access to a dedicated directory, normalize and validate any identifiers before use, and map tokens to file names via controlled server-side logic. Any path that escapes the designated root or violates the expected format should be rejected.

Adopt a security-by-design approach for all file-access logic: treat external identifiers as untrusted, centralize path-building and validation in vetted helper functions, enforce least-privilege filesystem permissions, and include path traversal checks in code review and automated security testing. Making these patterns part of development standards helps prevent reintroduction of similar vulnerabilities.

Find out what's already
exploitable in your codebase.