criticalVulnerability

CVE-2026-61740

## Summary When LightRAG is deployed with `LIGHTRAG_API_KEY` set but `AUTH_ACCOUNTS` unset (an officially documented "API-Key authentication" mode), the `X-API-Key` protection can be bypassed by any remote unauthenticated attacker. The bypass does not require network contact with the victim server — an attacker can mint a valid guest JWT offline using the hardcoded `DEFAULT_TOKEN_SECRET` committed in the repository and then call any endpoint guarded by `Depends(combined_auth)`, including destructive operations such as `DELETE /documents`, `POST /documents/upload`, `/documents/clear_cache`, and `POST /query`. This is distinct from the previously-fixed GHSA-mcww-4hxq-hfr3 / CVE-2026-30762, which only covered the `AUTH_ACCOUNTS`-configured case. The API-Key-only deployment profile is still fully exploitable on current `main` (commit `157c331`, v1.4.15). ## Root cause Three independent issues combine: 1. `lightrag/api/config.py:54` ships a hardcoded default JWT secret: ```python DEFAULT_TOKEN_SECRET="lightr...key!" ``` 2. `lightrag/api/auth.py:28-38` falls back to `DEFAULT_TOKEN_SECRET` with only a warning log when `AUTH_ACCOUNTS` is not configured. The fix for CVE-2026-30762 only raises when `AUTH_ACCOUNTS` is set, so the API-key-only path is silently vulnerable. 3. `lightrag/api/lightrag_server.py:1140-1186` exposes `GET /auth-status` and `POST /login` without any authentication dependency. In the API-key-only configuration, `auth_handler.accounts` is empty, and both endpoints unconditionally mint and return a signed guest JWT. 4. `lightrag/api/utils_api.py:214-216` inside `combined_dependency` short-circuits authorization on any valid guest token when `auth_configured` is false, **before** reaching the `X-API-Key` check on line 237: ```python if not auth_configured and token_info.get("role") == "guest": return ``` ## Proof of concept (offline-minted token, zero server contact) Tested against a clean install of commit `157c331` running

Properties

ghsa_id
GHSA-f4vv-55c2-5789
severity
critical
summary
LightRAG is Vulnerable to Authentication Bypass: hardcoded DEFAULT_TOKEN_SECRET and public /auth-status defeat LIGHTRAG_API_KEY protection
epss_score
0.00662
cve_id
CVE-2026-61740
is_ghsa_only
false
ghsa_published
2026-07-20T21:46:37Z
source_url
https://github.com/advisories/GHSA-f4vv-55c2-5789
epss_percentile
0.49269
ghsa_updated
2026-07-20T21:46:39Z

Related Entities (6)

ENRICHED_BY (1)

[Source]FIRST EPSS

HAS_WEAKNESS (2)

[Weakness]Improper Authentication
[Weakness]Use of Hard-coded Credentials

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]pip/lightrag-hku

AFFECTS (1)

[Software]pip/lightrag-hku

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-61740 — Ninja Signal Threat Intelligence | Ninja Signal