| Titel | eosphoros-ai DB-GPT v0.8.2 Insufficiently Protected Credentials |
|---|
| Beschreibung | DB-GPT Release, Revision, or Tag
`eosphorosai/dbgpt-openai:v0.8.2` (release tag `v0.8.2`, commit `83609c47`) —
also present on current `main` (the DAO and route are unchanged; verified
2026-11-10).
### Description
`GET /api/v1/chat/db/list` serializes every `connect_config` row — including
the plaintext `db_user` and `db_pwd` columns — to whoever calls it. Backend
database credentials (MySQL/PostgreSQL/etc.) are stored unencrypted and
returned with no authorization beyond reachability: any declared identity
receives the full credential set for **all** rows, not just its own. A single
GET hands out direct-connect credentials for every backend database the
deployment knows, bypassing DB-GPT entirely — including any read-only
restrictions its SQL tools impose.
```python
# connect_config_db.py:236-241 (identical v0.8.2..main)
elif user_id:
sql = f"SELECT * FROM connect_config where user_id='{user_id}' or user_id='' or user_id IS NULL"
# every row serialized to the API response, db_user and db_pwd included
```
### Root cause
- Entry route: `GET /api/v1/chat/db/list`
- Preconditions: network reachability (in the product's built-in declared-
identity auth mode, any name may be declared)
- Vulnerable code: route `api_v1.py:174-190`; serialization of `db_user`/
`db_pwd` in `connect_config_db.py::get_db_list`
- Root cause family: CWE-200 (Exposure of Sensitive Information) +
CWE-522 (credentials in plaintext at rest and in responses)
- Secondary surface (same DAO, noted not escalated): `user_id`/`db_name`
interpolated into SQL via f-strings (CWE-89 pattern — reported separately
as the SQL-injection finding)
- Controlling factor: none — unconditionally reachable
# Steps to reproduce
Lab verification 2026-10-26, unmodified v0.8.2 container with one MySQL
datasource registered (redacted response + SHA-256 archived:
`…/evidence/db_list_response.redacted.json`).
1. Setup — any deployment with at least one non-SQLite datasource.
2. Attack — a single GET with an arbitrary declared identity:
```bash
curl -s http://localhost:5670/api/v1/chat/db/list -H 'user-id: bob' \
| python -m json.tool | grep -E 'db_user|db_pwd'
```
Observed: `"db_user": "<real backend user>"` and `"db_pwd": "<real backend
password>"` for every configured datasource, including rows `bob` does not
own. The returned credentials were the live MySQL account of the backend.
3. Control — the listing exists to let users pick a datasource; names and
types suffice client-side. Credentials never need to leave the server.
### Expected behaviour
Never serialize credentials; restrict rows per caller even for shared
entries; store secrets encrypted at rest.
### Observed Behaviour
The complete plaintext credential set for every backend database connection
is returned to any caller in one unauthenticated-in-effect GET.
# Impact
Direct reuse of backend database credentials: an attacker connects to the
backend databases directly, bypassing the agent layer and every product-side
query restriction; credentials are tenant-wide, so one low-privilege user
compromises every other tenant's registered database. Combined with the
parameter-list enumeration endpoint, the attacker also learns which private
datasources the credentials belong to. |
|---|
| Quelle | ⚠️ https://github.com/eosphoros-ai/DB-GPT/issues/3392 |
|---|
| Benutzer | Anonymous User |
|---|
| Einreichung | 13.11.2026 03:43 (vor 24 Tagen) |
|---|
| Moderieren | 06.12.2026 21:59 (24 days later) |
|---|
| Status | Akzeptiert |
|---|
| VulDB Eintrag | 450889 [eosphoros-ai db-gpt bis 0.8.3 Chat DB Datasource Manager connect_config_db.py get_db_list Information Disclosure] |
|---|
| Punkte | 20 |
|---|