Browse / Sensitive Data Disclosure / CVE-2024-37895
Lobe Chat API Key Leak
- Class
- Sensitive Data Disclosure (filed by a model that read the advisory)
- Technique
- Data exfiltration
- Also involves
- AI Framework and Platform Flaws
- Affected
- @lobehub/chat (npm)
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N
- EPSS
- 0.5% chance of exploitation in 30 days
How it works, in short
A user can point the base URL at an attacker server, and the backend then sends its stored API key there in request headers. (Our summary, written by a model. The source text is below.)
Details
Summary
If an attacker can successfully authenticate through SSO/Access Code, they can obtain the real backend API Key by modifying the base URL to their own attack URL on the frontend and setting up a server-side request.
Details
The attack process is described above.
PoC
Frontend:
1. Pass basic authentication (SSO/Access Code).
2. Set the Base URL to a private attack address.
3. Configure the request method to be a server-side request.
4. At the self-set attack address, retrieve the API Key information from the request headers.
Backend:
1. The LobeChat version allows setting the Base URL.
2. There is no outbound traffic whitelist.
Impact
All community version LobeChat users using SSO/Access Code authentication, tested on version 0.162.13.
References
- https://github.com/lobehub/lobe-chat/security/advisories/GHSA-p36r-qxgx-jq2v
- https://nvd.nist.gov/vuln/detail/CVE-2024-37895
- https://github.com/lobehub/lobe-chat
Source: GitHub Advisory Database, used under CC BY 4.0.