Summary
An authorization bypass in tenant management endpoints of WeKnora application allows any authenticated user to read, modify, or delete any tenant by ID. Since account registration is open to the public, this vulnerability allows any unauthenticated attacker to register an account and subsequently exploit the system. This enables cross-tenant account takeover and destruction, making the impact critical.
Details
The tenant management handlers do not validate that the caller owns the tenant or has cross-tenant privileges. The handlers parse the tenant ID from the path and directly call the service layer with that ID, returning or mutating the tenant without authorization checks.
Affected handlers:
GET /api/v1/tenants lists all tenants without ownership checks
GET /api/v1/tenants/{id} reads any tenant by ID without ownership checks
PUT /api/v1/tenants/{id} allows updating any tenant by ID without ownership checks
DELETE /api/v1/tenants/{id} allows deleting any tenant by ID without ownership checks
These endpoints do not enforce cross-tenant permissions or deny-by-default behavior, unlike ListAllTenants and SearchTenants.
PoC
-
Register a new account as a user in Tenant 10025 and obtain a bearer token or API key.
-
Read details of other tenants:
With API keys, we can do anything on the victim account's behalf, including reading sensitive data (LLM API keys, knowledge bases), modifying configurations, etc.
Requests to perform modification and deletion of another tenant.
- Modify the victim tenant:
-
Request:
- Method:
PUT
- URL:
http://localhost:8088/api/v1/tenants/10001
- Header:
Authorization: Bearer <ATTACKER_TOKEN>
- Body:
{ "name": "HACKED by tenant 10025" }
-
Expected response:
200 OK with the updated tenant object.
- Delete the victim tenant:
-
Request:
- Method:
DELETE
- URL:
http://localhost:8088/api/v1/tenants/10001
- Header:
Authorization: Bearer <ATTACKER_TOKEN>
-
Expected response:
200 OK and the tenant is deleted.
Impact
This is a Broken Access Control (BOLA/IDOR) vulnerability in tenant management of WeKnora. Any user can access, modify, or delete tenants belonging to other customers, resulting in cross-tenant data exposure, account takeover, and destructive actions against other tenants. Moreover, when the account is taken over, attacker can read configured models to unauthorizedly extract sensitive data such as API keys of LLM services.
Summary
An authorization bypass in tenant management endpoints of WeKnora application allows any authenticated user to read, modify, or delete any tenant by ID. Since account registration is open to the public, this vulnerability allows any unauthenticated attacker to register an account and subsequently exploit the system. This enables cross-tenant account takeover and destruction, making the impact critical.
Details
The tenant management handlers do not validate that the caller owns the tenant or has cross-tenant privileges. The handlers parse the tenant ID from the path and directly call the service layer with that ID, returning or mutating the tenant without authorization checks.
Affected handlers:
GET /api/v1/tenantslists all tenants without ownership checksGET /api/v1/tenants/{id}reads any tenant by ID without ownership checksPUT /api/v1/tenants/{id}allows updating any tenant by ID without ownership checksDELETE /api/v1/tenants/{id}allows deleting any tenant by ID without ownership checksThese endpoints do not enforce cross-tenant permissions or deny-by-default behavior, unlike
ListAllTenantsandSearchTenants.PoC
Register a new account as a user in Tenant 10025 and obtain a bearer token or API key.
Read details of other tenants:
Request that uses API key via the
X-API-Keyheader:Response (truncated for brevity):
With API keys, we can do anything on the victim account's behalf, including reading sensitive data (LLM API keys, knowledge bases), modifying configurations, etc.
Requests to perform modification and deletion of another tenant.
Request:
PUThttp://localhost:8088/api/v1/tenants/10001Authorization: Bearer <ATTACKER_TOKEN>{ "name": "HACKED by tenant 10025" }Expected response:
200 OKwith the updated tenant object.Request:
DELETEhttp://localhost:8088/api/v1/tenants/10001Authorization: Bearer <ATTACKER_TOKEN>Expected response:
200 OKand the tenant is deleted.Impact
This is a Broken Access Control (BOLA/IDOR) vulnerability in tenant management of WeKnora. Any user can access, modify, or delete tenants belonging to other customers, resulting in cross-tenant data exposure, account takeover, and destructive actions against other tenants. Moreover, when the account is taken over, attacker can read configured models to unauthorizedly extract sensitive data such as API keys of LLM services.