Invia #1093941: eosphoros-ai DB-GPT v0.8.2 Missing Authenticationinformazioni

Titoloeosphoros-ai DB-GPT v0.8.2 Missing Authentication
DescrizioneDB-GPT Release, Revision, or Tag `eosphorosai/dbgpt-openai:v0.8.2` (release tag `v0.8.2`, commit `83609c47`) — also present on current `main` (verified 2026-11-10: `knowledge/api.py:66` `router = APIRouter()` with no `dependencies=` anywhere). ### Description The knowledge API manages knowledge spaces — user-uploaded document collections that are embedded and used to answer questions. The **entire router has no authentication dependency and no ownership model**: space deletion (`shutil.rmtree` of the document directory + deletion of the space row), space creation, document upload (storage write), document deletion, chunk editing, and argument saving are all reachable without any credentials, and the `owner` column of `knowledge_space` is never written or checked. Reading without a user filter may be defensible as an intended single-tenant deployment posture; what is not defensible is that **destruction, upload, and tampering** are available to any network caller. ```python # knowledge/api.py:114-131 (v0.8.2, abridged) @router.post("/knowledge/space/delete") def space_delete(request: KnowledgeSpaceRequest): safe_space_name = os.path.basename(request.name) space_dir = os.path.abspath(os.path.join(KNOWLEDGE_UPLOAD_ROOT_PATH, safe_space_name)) if os.path.exists(space_dir): shutil.rmtree(space_dir) # wipe uploaded documents return Result.succ(knowledge_space_service.delete_space(request.name)) ``` ### Root cause - Entry routes: `POST /api/v1/knowledge/space/delete`, `/space/add`, `/{space}/document/upload`, `/{space}/document/delete`, `/{space}/chunk/edit`, `/{space_id}/argument/save` (router at `packages/dbgpt-app/src/dbgpt_app/knowledge/api.py:66`, routes at 86–631) - Preconditions: network reachability; none else - Root cause family: CWE-306 (Missing Authentication for Critical Function) + CWE-284/668 (object-level authorization absent; declared `owner` column dead) - Contrast: sibling serve routers (e.g. `datasources/refresh`) require at least `check_api_key` — the knowledge router has nothing - Controlling factor: none — unconditionally reachable # Steps to reproduce Two rounds of dynamic verification on the unmodified v0.8.2 container (cross-user run 2026-10-26; unauthenticated run 2026-11-10, evidence: `CrossOp-Lab/results_sqli_know_shots.json`). 1. Setup — `alice` creates a knowledge space: ```bash curl -s -X POST http://localhost:5670/api/v1/knowledge/space/add \ -H 'user-id: alice' -H 'Content-Type: application/json' \ -d '{"name":"alice_private_kb","vector_type":"Chroma","desc":"private"}' ``` 2. Cross-user destroy — `bob` deletes `alice`'s space: `POST /api/v1/knowledge/space/delete` with `user-id: bob`, body `{"name":"alice_private_kb"}`. Observed (2026-10-26, twice): HTTP 200, success; documents, embeddings, and the space record are gone from `alice`'s view. 3. Fully unauthenticated destroy — the same delete **with no headers at all**: ```bash curl -s -X POST http://localhost:5670/api/v1/knowledge/space/delete \ -H 'Content-Type: application/json' -d '{"name":"alice_private_kb"}' ``` Observed (2026-11-10): HTTP 200 `success:true`; the space no longer appears in the subsequent space list. 4. Control — re-creating the space as `alice` succeeds: the API works normally; only authorization/authentication is absent. ### Expected behaviour The router must require authentication; `owner` must be written server-side on creation and enforced on every mutation (ownership or admin role for deletion/upload/chunk editing). ### Observed Behaviour Any network caller — with no account — irreversibly destroys other users' knowledge spaces and can create/upload/tamper content (unauthenticated storage-write primitive via `document/upload`). # Impact Irreversible loss of availability and integrity for tenants' curated knowledge bases (months of embedding/indexing destroyed by one unauthenticated POST); unauthenticated document upload writes attacker-chosen content into the storage backing retrieval (content-poisoning vector for answers derived from the knowledge base); the dead `owner` column means an authentication layer alone would not restore isolation.
Fonte⚠️ https://github.com/eosphoros-ai/DB-GPT/issues/3390
Utente
 Anonymous User
Sottomissione13/11/2026 03:29 (24 giorni fa)
Moderazione06/12/2026 21:59 (24 days later)
StatoAccettato
Voce VulDB450887 [eosphoros-ai db-gpt fino a 0.8.3 Knowledge api.py space_delete name autenticazione debole]
Punti20

Do you need the next level of professionalism?

Upgrade your account now!