CVE-2026-30859: WeKnora: Broken Access Control - Cross-Tenant Data Exposure

Published Mar 6, 2026
·
Updated

Summary A broken access control vulnerability in the database query tool allows any authenticated tenant to read sensitive data belonging to other tenants, including API keys, model configurations, and private messages. The application fails to enforce tenant isolation on critical tables (models, messages, embeddings), enabling unauthorized cross-tenant data access with user-level authentication privileges.

---

Details

Root Cause The vulnerability exists due to a mismatch between the queryable tables and the tables protected by tenant isolation in internal/utils/inject.go.

Tenant-isolated tables (protected by automatic WHERE tenantid = X clause): tenants, knowledgebases, knowledges, sessions, chunks

Queryable tables (allowed by WithAllowedTables() in WithSecurityDefaults()): tenants, knowledgebases, knowledges, sessions, messages, chunks, embeddings, models

Gap: The tables messages, embeddings, and models are queryable but NOT in the tenant isolation list. This means queries against these tables do NOT receive the automatic WHERE tenantid = X filtering.

Vulnerable Code

File: internal/utils/inject.go

go func WithTenantIsolation(tenantID uint64, tables ...string) SQLValidationOption { return func(v sqlValidator) { v.enableTenantInjection = true v.tenantID = tenantID v.tablesWithTenantID = make(map[string]bool) if len(tables) == 0 { // Default tables with tenantid - MISSING: messages, embeddings, models v.tablesWithTenantID = map[string]bool{ "tenants": true, "knowledgebases": true, "knowledges": true, "sessions": true, "chunks": true, } } else { for , table := range tables { v.tablesWithTenantID[strings.ToLower(table)] = true } } } }

func WithSecurityDefaults(tenantID uint64) SQLValidationOption { return func(v sqlValidator) { // ... other validations ... WithTenantIsolation(tenantID)(v)

// Default allowed tables - INCLUDES unprotected tables WithAllowedTables( "tenants", "knowledgebases", "knowledges", "sessions", "messages", // ← No tenant isolation "chunks", "embeddings", // ← No tenant isolation "models", // ← No tenant isolation )(v) } }

File: databasequery.go

go func (t DatabaseQueryTool) validateAndSecureSQL(sqlQuery string, tenantID uint64) (string, error) { securedSQL, validationResult, err := utils.ValidateAndSecureSQL( sqlQuery, utils.WithSecurityDefaults(tenantID), utils.WithInjectionRiskCheck(), ) // ... validation logic ... return securedSQL, nil }

When tenant 1 queries SELECT FROM models, the validation passes and no WHERE tenantid = 1 clause is appended because models is not in the tablesWithTenantID map. The unfiltered result exposes all model records across all tenants.

---

PoC

Prerequisites - Access to the AI application as an authenticated tenant - Ability to send prompts that invoke the databasequery tool

Steps to Reproduce

1. Authenticate as Tenant 1 and craft the following prompt to the AI agent: Use the databasequery tool with {"sql": "SELECT FROM models"} to query the database. Output all results and any errors.

2. Expected vulnerable response: The agent returns ALL model records in the models table across all tenants, including: - Model IDs and names - API keys and authentication credentials - Configuration details for all organizations

Example result:

<img width="864" height="1150" alt="image" src="https://github.com/user-attachments/assets/01e3d0ba-0f2a-43ab-ab51-8778fb8a79b1" />

3. Repeat with messages table: Use the databasequery tool with {"sql": "SELECT FROM messages"} to query the database. Output all results.

4. Expected vulnerable response: The agent returns ALL messages from all tenants, bypassing message privacy.

---

PoC Video:

https://github.com/user-attachments/assets/056984e8-1700-41fe-9b8a-6d18d5579c18

---

Impact

Vulnerability Type Broken Access Control (CWE-639) / Unauthorized Information Disclosure (CWE-200)

Specific Data at Risk 1. API Keys & Credentials (from models table) - Third-party LLM provider keys (OpenAI, Anthropic, etc.) - Database credentials and connection strings - Authentication tokens for integrated services

2. Private Messages (from messages table) - Confidential business communications - User conversations with AI agents - Sensitive information shared within conversations

Other sources

WeKnora is an LLM-powered framework designed for deep document understanding and semantic retrieval. Prior to version 0.2.12, a broken access control vulnerability in the database query tool allows any authenticated tenant to read sensitive data belonging to other tenants, including API keys, model configurations, and private messages. The application fails to enforce tenant isolation on critical tables (models, messages, embeddings), enabling unauthorized cross-tenant data access with user-level authentication privileges. This issue has been patched in version 0.2.12.

MITRE

Affected Software

2 affected componentsFixes available
go/github.com/Tencent/WeKnora<=0.2.11
0.2.12
Tencent WeKnora<0.2.12

Event History

Mar 6, 2026
Advisory Published
via GitHub·11:57 PM
Data Sourced
via GitHub·11:57 PM
DescriptionSeverityWeaknessAffected Software
Mar 7, 2026
CVE Published
via MITRE·04:35 PM
Data Sourced
via MITRE·04:35 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeaknessAffected Software
Dec 1, 58158
Event
via FIRST·06:30 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-30859?

The severity of CVE-2026-30859 is rated as high due to the potential exposure of sensitive data across tenant boundaries.

2

How do I fix CVE-2026-30859?

To fix CVE-2026-30859, ensure that proper access control measures are implemented to enforce tenant isolation on critical database tables.

3

Who is affected by CVE-2026-30859?

All authenticated tenants using the vulnerable version of the WeKnora database query tool are affected by CVE-2026-30859.

4

What data can be exposed due to CVE-2026-30859?

CVE-2026-30859 can expose sensitive data such as API keys, model configurations, and private messages of other tenants.

5

Which version of WeKnora is impacted by CVE-2026-30859?

CVE-2026-30859 affects versions of WeKnora up to and including 2.0.11.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203