Executive brief
LightRAG, a tool used for fast retrieval-augmented generation in AI applications, contains a security flaw in its API authentication. An attacker can bypass security checks by providing a specially crafted login token that claims to have no security signature. This allows unauthorized individuals to impersonate users, including administrators, potentially leading to full access to sensitive data and protected system resources.
Technical details
The LightRAG API is vulnerable to a JWT algorithm confusion attack in the `validate_token` method within `lightrag/api/auth.py`. The root cause is that the `jwt.decode()` call does not explicitly restrict the allowed algorithms, permitting the 'none' algorithm to be accepted. A remote attacker can exploit this by crafting a JWT with the 'alg' header set to 'none' and omitting the signature. This allows the attacker to bypass authentication and impersonate any user, including administrators. The vulnerability is fixed in version 1.4.14 by explicitly defining allowed cryptographic algorithms.
Affected products
- HKUDS LightRAG < 1.4.14
Timeline
- 2026-04-07: advisory: GitHub Security Advisory GHSA-8ffj-4hx4-9pgf published
- 2026-04-08: disclosed: CVE-2026-39413 published to NVD
- 2026-04-14: patched: Vulnerability fixed in version 1.4.14