CVE-2026-22687
Unknown Unknown - Not Provided
Prompt Injection in WeKnora Agent Enables Sensitive Data Exposure

Publication date: 2026-01-10

Last updated on: 2026-03-06

Assigner: GitHub, Inc.

Description
WeKnora is an LLM-powered framework designed for deep document understanding and semantic retrieval. Prior to version 0.2.5, after WeKnora enables the Agent service, it allows users to call the database query tool. Due to insufficient backend validation, an attacker can use prompt‑based bypass techniques to evade query restrictions and obtain sensitive information from the target server and database. This issue has been patched in version 0.2.5.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-01-10
Last Modified
2026-03-06
Generated
2026-06-16
AI Q&A
2026-01-10
EPSS Evaluated
2026-06-15
NVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
tencent weknora to 0.2.4 (exc)
tencent weknora 0.2.5
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-89 The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

This vulnerability is a high-severity SQL injection issue in the WeKnora framework's database query tool when the Agent service is enabled. Due to insufficient backend validation of SQL queries, attackers can use crafted prompts to bypass query restrictions. Specifically, the system fails to properly check for dangerous PostgreSQL built-in functions and does not handle SQL comments that can obfuscate malicious queries. This allows attackers to execute unauthorized SQL commands, access sensitive information from the database, enumerate database contents, and even read or write files on the PostgreSQL server. [1]

Impact Analysis

This vulnerability can have severe impacts including unauthorized access to all database contents across multiple tenants, exposure of sensitive information, and potential manipulation of data integrity. Attackers can also list and access PostgreSQL server files, enabling them to read or write files on the server. Overall, it compromises confidentiality, integrity, and availability of the system, potentially leading to data breaches and service disruptions. [1]

Detection Guidance

Detection of this vulnerability involves monitoring for unusual or crafted SQL queries that attempt to bypass backend validation, especially those using PostgreSQL built-in functions like pg_ls_dir or queries containing obfuscated SQL comments (e.g., /**/). Since the vulnerability exploits prompt-based SQL injection via the WeKnora Agent service, inspecting logs for suspicious raw SQL queries executed by the database query tool is recommended. Specific commands depend on your logging setup, but generally, you can search database logs or application logs for queries containing 'pg_ls_dir', 'pg_language', or unusual comment patterns. For example, using grep on logs: `grep -E "pg_ls_dir|pg_language|\/\*\*\/" /path/to/weknora/logs/*` or monitoring network traffic for suspicious SQL payloads targeting the Agent service. Additionally, checking the version of WeKnora to ensure it is 0.2.5 or later helps confirm if the vulnerability is present. [1]

Mitigation Strategies

The immediate mitigation step is to upgrade WeKnora to version 0.2.5 or later, where the vulnerability has been patched by reconstructing the SQL security validation mechanism using the official PostgreSQL parser. This update significantly improves query protection and prevents prompt-based bypass techniques. If upgrading is not immediately possible, consider disabling the Agent service to prevent access to the vulnerable database query tool. Additionally, monitor and restrict access to the service to trusted users only and audit logs for suspicious activity until the patch can be applied. [1, 2]

Compliance Impact

This vulnerability allows attackers to bypass query restrictions and access sensitive information from the target server and database, leading to high confidentiality, integrity, and availability impacts. Such unauthorized access to sensitive data can result in non-compliance with data protection regulations like GDPR and HIPAA, which require strict controls to protect personal and sensitive information. Therefore, exploitation of this vulnerability could lead to violations of these standards due to data breaches and unauthorized data exposure. [1]

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-22687. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart