CVE-2024-37895
📋 TL;DR
This vulnerability in Lobe Chat allows authenticated attackers to steal backend API keys by manipulating frontend base URLs to redirect requests to attacker-controlled servers. It affects all Lobe Chat deployments using SSO or Access Code authentication before version 0.162.25.
💻 Affected Systems
- Lobe Chat
📦 What is this software?
Lobe Chat by Lobehub
⚠️ Risk & Real-World Impact
Worst Case
Attackers gain access to backend API keys, potentially compromising the entire AI chat system and associated services, leading to data theft, unauthorized access, or service disruption.
Likely Case
Attackers exfiltrate API keys to access backend services, potentially enabling further attacks on the AI infrastructure or data leakage.
If Mitigated
With proper network segmentation and API key rotation, impact is limited to temporary service disruption until keys are revoked.
🎯 Exploit Status
Requires attacker to have valid SSO/Access Code authentication first, then modify frontend configuration.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.162.25
Vendor Advisory: https://github.com/lobehub/lobe-chat/security/advisories/GHSA-p36r-qxgx-jq2v
Restart Required: Yes
Instructions:
1. Backup current configuration. 2. Update Lobe Chat to version 0.162.25 or later. 3. Restart the Lobe Chat service. 4. Verify the update was successful.
🧯 If You Can't Patch
- Disable SSO and Access Code authentication methods if possible
- Implement strict network controls to prevent outbound connections to unauthorized servers
🔍 How to Verify
Check if Vulnerable:
Check Lobe Chat version - if below 0.162.25 and using SSO/Access Code auth, system is vulnerable.
Check Version:
Check package.json or deployment configuration for version number
Verify Fix Applied:
Confirm version is 0.162.25 or later and test that base URL modifications no longer expose API keys.
📡 Detection & Monitoring
Log Indicators:
- Unusual base URL modifications in frontend requests
- API key access from unexpected IP addresses
Network Indicators:
- Outbound connections to unfamiliar servers from Lobe Chat backend
- Unusual API key usage patterns
SIEM Query:
source="lobe-chat" AND (url_contains("baseURL") OR api_key_access)