CVE-2026-23522: 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.
Published Jan 20, 2026
Affected packages
@lobehub/chat
- Ecosystem
- npm
- Affected
- <= 1.143.2
- Fixed in
- No patched version yet
- Check
npm ls @lobehub/chat
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to DenizParlak.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More LobeChat vulnerabilities
All LobeChat entriesCVE-2026-23835
LobeHub Vulnerable to Improper Authorization in Presigned Upload
medium5.7Feb 1, 2026CVE-2026-23733
Lobe Chat affected by Cross-Site Scripting(XSS) that can escalate to Remote Code Execution(RCE)
critical9.6No fixJan 20, 2026CVE-2025-62505
Lobe Chat vulnerable to Server-Side Request Forgery with native web fetch module
low3.0Oct 17, 2025CVE-2025-59426
lobe-chat has an Open Redirect
medium4.3Sep 24, 2025CVE-2025-59417
Lobe Chat Desktop vulnerable to Remote Code Execution via XSS in Chat Messages
medium6.8Sep 18, 2025CVE-2024-32965
@lobehub/chat Server Side Request Forgery vulnerability
high8.1Nov 26, 2024
