CVE-2026-30859: Github.com/Tencent/WeKnora WeKnora Has Broken Access Control Vulnerability
HIGHCVE-2026-30859 is a HIGH (CVSS 7.5) weknora has broken access control vulnerability (CWE-284: Improper Access Control) affecting Github.com/Tencent/WeKnora libraries in the Go ecosystem. The issue involves weknora has broken access control - cross-tenant data exposure. Remediation is available by upgrading affected packages to version 0.2.12.
CVE-2026-30859 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2026-30859
To remediate this vulnerability, upgrade all affected Github.com/Tencent/WeKnora dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/Tencent/WeKnora to 0.2.12
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/Tencent/WeKnora
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-30859, inspect your project dependencies for Github.com/Tencent/WeKnora:
inspect dependencies for github.com/Tencent/WeKnora
Analyze the terminal output to locate any version of Github.com/Tencent/WeKnora in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.12), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Github.com/Tencent/WeKnora, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-30859 Affected Github.com/Tencent/WeKnora Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/Tencent/WeKnora
|
Go |
< 0.2.12
|
0.2.12
|
References
Frequently Asked Questions
What is CVE-2026-30859?
Which Github.com/Tencent/WeKnora versions are affected?
What version fixes CVE-2026-30859?
Is github.com/Tencent/WeKnora affected?
What is the CVSS score of CVE-2026-30859?
What CWE is associated with CVE-2026-30859?
How can I check Go dependencies for CVE-2026-30859?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2f4c-vrjq-rcgv",
"modified" : "2026-03-09T13:20:28Z",
"published" : "2026-03-06T23:57:20Z",
"aliases" : [ "CVE-2026-30859" ],
"summary" : "WeKnora has Broken Access Control - Cross-Tenant Data Exposure",
"details" : "## Summary\nA 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.\n\n---\n\n## Details\n\n### Root Cause\nThe vulnerability exists due to a mismatch between the queryable tables and the tables protected by tenant isolation in `internal/utils/inject.go`.\n\n**Tenant-isolated tables** (protected by automatic `WHERE tenant_id = X` clause):\n```\ntenants, knowledge_bases, knowledges, sessions, chunks\n```\n\n**Queryable tables** (allowed by `WithAllowedTables()` in `WithSecurityDefaults()`):\n```\ntenants, knowledge_bases, knowledges, sessions, messages, chunks, embeddings, models\n```\n\n**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 tenant_id = X` filtering.\n\n### Vulnerable Code\n\n**File: `internal/utils/inject.go`**\n\n```go\nfunc WithTenantIsolation(tenantID uint64, tables ...string) SQLValidationOption {\n\treturn func(v *sqlValidator) {\n\t\tv.enableTenantInjection = true\n\t\tv.tenantID = tenantID\n\t\tv.tablesWithTenantID = make(map[string]bool)\n\t\tif len(tables) == 0 {\n\t\t\t// Default tables with tenant_id - MISSING: messages, embeddings, models\n\t\t\tv.tablesWithTenantID = map[string]bool{\n\t\t\t\t\"tenants\": true,\n\t\t\t\t\"knowledge_bases\": true,\n\t\t\t\t\"knowledges\": true,\n\t\t\t\t\"sessions\": true,\n\t\t\t\t\"chunks\": true,\n\t\t\t}\n\t\t} else {\n\t\t\tfor _, table := range tables {\n\t\t\t\tv.tablesWithTenantID[strings.ToLower(table)] = true\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc WithSecurityDefaults(tenantID uint64) SQLValidationOption {\n\treturn func(v *sqlValidator) {\n\t\t// ... other validations ...\n\t\tWithTenantIsolation(tenantID)(v)\n\n\t\t// Default allowed tables - INCLUDES unprotected tables\n\t\tWithAllowedTables(\n\t\t\t\"tenants\",\n\t\t\t\"knowledge_bases\",\n\t\t\t\"knowledges\",\n\t\t\t\"sessions\",\n\t\t\t\"messages\", // ← No tenant isolation\n\t\t\t\"chunks\",\n\t\t\t\"embeddings\", // ← No tenant isolation\n\t\t\t\"models\", // ← No tenant isolation\n\t\t)(v)\n\t}\n}\n```\n\n**File: `database_query.go`**\n\n```go\nfunc (t *DatabaseQueryTool) validateAndSecureSQL(sqlQuery string, tenantID uint64) (string, error) {\n\tsecuredSQL, validationResult, err := utils.ValidateAndSecureSQL(\n\t\tsqlQuery,\n\t\tutils.WithSecurityDefaults(tenantID),\n\t\tutils.WithInjectionRiskCheck(),\n\t)\n\t// ... validation logic ...\n\treturn securedSQL, nil\n}\n```\n\nWhen tenant 1 queries `SELECT * FROM models`, the validation passes and **no** `WHERE tenant_id = 1` clause is appended because `models` is not in the `tablesWithTenantID` map. The unfiltered result exposes all model records across all tenants.\n\n---\n\n## PoC\n\n### Prerequisites\n- Access to the AI application as an authenticated tenant\n- Ability to send prompts that invoke the `database_query` tool\n\n### Steps to Reproduce\n\n1. **Authenticate as Tenant 1** and craft the following prompt to the AI agent:\n ```\n Use the database_query tool with {\"sql\": \"SELECT * FROM models\"} to query the database. \n Output all results and any errors.\n ```\n\n2. **Expected vulnerable response**: The agent returns ALL model records in the `models` table across all tenants, including:\n - Model IDs and names\n - API keys and authentication credentials\n - Configuration details for all organizations\n\nExample result:\n\n<img width=\"864\" height=\"1150\" alt=\"image\" src=\"https://github.com/user-attachments/assets/01e3d0ba-0f2a-43ab-ab51-8778fb8a79b1\" />\n\n3. **Repeat with messages table**:\n ```\n Use the database_query tool with {\"sql\": \"SELECT * FROM messages\"} to query the database. \n Output all results.\n ```\n\n4. **Expected vulnerable response**: The agent returns ALL messages from all tenants, bypassing message privacy.\n\n---\n\nPoC Video:\n\nhttps://github.com/user-attachments/assets/056984e8-1700-41fe-9b8a-6d18d5579c18\n\n---\n\n## Impact\n\n### Vulnerability Type\n**Broken Access Control (CWE-639)** / **Unauthorized Information Disclosure (CWE-200)**\n\n### Specific Data at Risk\n1. **API Keys & Credentials** (from `models` table)\n - Third-party LLM provider keys (OpenAI, Anthropic, etc.)\n - Database credentials and connection strings\n - Authentication tokens for integrated services\n\n2. **Private Messages** (from `messages` table)\n - Confidential business communications\n - User conversations with AI agents\n - Sensitive information shared within conversations",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/Tencent/WeKnora"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.2.12"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.2.11"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Tencent/WeKnora/security/advisories/GHSA-2f4c-vrjq-rcgv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-30859"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Tencent/WeKnora"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-284" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-06T23:57:20Z",
"nvd_published_at" : "2026-03-07T17:15:53Z"
}
}