Free AI Safety Workshop — in collaboration with explainx.aiSave your seat
AgentbeamBeta
AI agent vulnerability · LobeChat

CVE-2024-37895: Lobe Chat API Key Leak

mediumCVSS 3.1 5.7GHSA-p36r-qxgx-jq2v

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.

Published Jun 17, 2024

Affected packages

@lobehub/chat

Ecosystem
npm
Affected
< 0.162.25
Fixed in
0.162.25
Check
npm ls @lobehub/chat

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to zhuozhiyongde.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More LobeChat vulnerabilities

All LobeChat entries