CVE-2024-37895: API Key Leak in lobe-chat
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.
!image
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.
Other sources
Lobe Chat is an open-source LLMs/AI chat framework. In affected versions 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. This issue has been addressed in version 0.162.25. Users are advised to upgrade. There are no known workarounds for this vulnerability.
— MITRE
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2024-37895?
CVE-2024-37895 is classified as a high severity vulnerability due to its potential for unauthorized API key exposure.
How do I fix CVE-2024-37895?
To mitigate CVE-2024-37895, ensure that all backend API keys are securely stored and not exposed to the frontend.
What is the attack vector for CVE-2024-37895?
The attack vector for CVE-2024-37895 involves exploiting authenticated sessions via SSO/Access Code to access the backend API Key.
Which software versions are affected by CVE-2024-37895?
CVE-2024-37895 affects the @lobehub/chat package version 0.162.25 and below.
Can CVE-2024-37895 lead to data breaches?
Yes, exploiting CVE-2024-37895 can allow an attacker to access sensitive backend data, leading to potential data breaches.