CVE-2024-37895: @lobehub/chat Lobe Chat API Key Leak Vulnerability
MODERATECVE-2024-37895 is a MODERATE (CVSS 5.7) lobe chat api key leak vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting @lobehub/chat libraries in the npm ecosystem. The issue involves lobe chat api key leak. Remediation is available by upgrading affected packages to version 0.162.25.
CVE-2024-37895 at a Glance
Security Impact
CVSS: 5.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2024-37895
To remediate this vulnerability, upgrade all affected @lobehub/chat dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @lobehub/chat@0.162.25
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @lobehub/chat
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-37895, inspect your project dependencies using npm:
npm ls @lobehub/chat
Analyze the terminal output to locate any version of @lobehub/chat in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.162.25), your application is affected.
Note: The npm ls @lobehub/chat command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In @lobehub/chat, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-37895 Affected @lobehub/chat Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@lobehub/chat
|
npm |
< 0.162.25
|
0.162.25
|
References
Frequently Asked Questions
What is CVE-2024-37895?
Which @lobehub/chat versions are affected?
What version fixes CVE-2024-37895?
Is @lobehub/chat affected?
What is the CVSS score of CVE-2024-37895?
What CWE is associated with CVE-2024-37895?
How can I check npm dependencies for CVE-2024-37895?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-p36r-qxgx-jq2v",
"modified" : "2024-06-17T22:28:41Z",
"published" : "2024-06-17T22:28:41Z",
"aliases" : [ "CVE-2024-37895" ],
"summary" : "Lobe Chat API Key Leak",
"details" : "### Summary\n\nIf 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.\n\n### Details\n\nThe attack process is described above.\n\n\n\n### PoC\n\nFrontend:\n1. Pass basic authentication (SSO/Access Code).\n2. Set the Base URL to a private attack address.\n3. Configure the request method to be a server-side request.\n4. At the self-set attack address, retrieve the API Key information from the request headers.\n\nBackend:\n1. The LobeChat version allows setting the Base URL.\n2. There is no outbound traffic whitelist.\n\n### Impact\n\nAll community version LobeChat users using SSO/Access Code authentication, tested on version 0.162.13.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@lobehub/chat"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.162.25"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/lobehub/lobe-chat/security/advisories/GHSA-p36r-qxgx-jq2v"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37895"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/lobehub/lobe-chat"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200", "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-17T22:28:41Z",
"nvd_published_at" : "2024-06-17T20:15:13Z"
}
}