Skip to content

Lobe Chat API Key Leak

Moderate severity GitHub Reviewed Published Jun 17, 2024 in lobehub/lobe-chat • Updated Jun 17, 2024

Package

npm @lobehub/chat (npm)

Affected versions

< 0.162.25

Patched versions

0.162.25

Description

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.

References

@arvinxx arvinxx published to lobehub/lobe-chat Jun 17, 2024
Published by the National Vulnerability Database Jun 17, 2024
Published to the GitHub Advisory Database Jun 17, 2024
Reviewed Jun 17, 2024
Last updated Jun 17, 2024

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N

EPSS score

0.043%
(11th percentile)

CVE ID

CVE-2024-37895

GHSA ID

GHSA-p36r-qxgx-jq2v

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.