Mar 1, 2026·6 min read·79 visits
Unauthenticated attackers can execute arbitrary SQL on XWiki instances by sending crafted HQL queries to the REST API. This bypasses security filters, allowing full database access.
A critical SQL injection vulnerability exists in the XWiki Platform REST API, specifically within the query endpoint handling. The flaw allows unauthenticated remote attackers to bypass Hibernate Query Language (HQL) safety checks using crafted 'short-form' queries. By manipulating input verification logic, attackers can escape the HQL context and execute arbitrary SQL commands against the underlying database, leading to potential data exfiltration, modification, or denial of service.
CVE-2025-32969 is a critical SQL injection vulnerability affecting the XWiki Platform, a generic wiki platform written in Java. The vulnerability resides in the REST API component, specifically at the /rest/wikis/{wiki}/query endpoint. This endpoint allows users to perform searches using languages like Hibernate Query Language (HQL) or XWiki Query Language (XWQL). Ideally, these languages are abstractions that prevent direct SQL manipulation. However, the implementation failed to correctly sanitize specific 'short-form' HQL queries—queries that omit the SELECT clause and start directly with WHERE or ORDER BY.
Due to improper validation logic in the HqlQueryExecutor, an unauthenticated attacker can supply a malicious payload that the system interprets as a safe HQL fragment. In reality, the payload contains escape sequences that break out of the HQL parser's intended context. Once the query is translated to native SQL by the Hibernate engine, the injected SQL commands are executed by the database. This effectively grants the attacker direct interaction with the database management system (DBMS) with the privileges of the XWiki database user.
The vulnerability is rated Critical (CVSS 9.8) because it requires no authentication, can be exploited remotely over the network, and requires no user interaction. It affects a wide range of XWiki versions, from 1.8 up to recent releases in the 15.x and 16.x branches.
The root cause of this vulnerability is twofold: a logic error in query sanitization and the usage of an insecure query manager in the REST API context.
First, the HqlQueryExecutor.isSafeSelect method is responsible for ensuring that user-provided HQL does not contain dangerous constructs before execution. XWiki supports 'short-form' queries (e.g., where doc.name like 'A%'), which the system automatically expands into a full select statement. The vulnerability arose because the validation logic did not fully normalize these short-form queries before checking them. Attackers discovered that by using specific character sequences—such as combining backslashes with single quotes (1<>'1\')—they could confuse the HQL parser. The parser would interpret the input as a safe string literal, while the underlying SQL driver would interpret the escape characters differently, allowing the attacker to close the string and append raw SQL commands (e.g., UNION SELECT).
Second, the AbstractDatabaseSearchSource component, which handles REST API search requests, was injecting a generic QueryManager rather than the explicitly secured variant. The standard QueryManager does not automatically apply the rigorous authorization filters and context-aware checks required for public-facing endpoints. This architectural oversight meant that even if the HQL injection was difficult, the authorization boundaries were weaker than intended, facilitating the bypass of wiki-specific security policies.
The remediation for CVE-2025-32969 involved hardening the query executor and enforcing the use of secure components. The fix was applied in commit 5c11a874bd24a581f534d283186e209bbccd8113.
1. Enforcing Secure Query Manager
In AbstractDatabaseSearchSource.java, the dependency injection was updated to explicitly request the secure QueryManager. This ensures that all queries processed through this source are subject to stricter security constraints by default.
// Vulnerable Code
@Inject
private QueryManager queryManager;
// Fixed Code
@Inject
@Named("secure") // Explicitly use the secure implementation
private QueryManager queryManager;2. Normalizing Short-Form Queries
The most critical fix occurred in HqlQueryExecutor.java. The updated code ensures that any query identified as a short-form statement is fully normalized (expanded into a complete SELECT statement) before it is passed to the safety validator. This prevents the validator from analyzing a partial fragment that looks safe but becomes dangerous upon expansion.
// Logic pseudo-code for the fix in HqlQueryExecutor
public void checkAllowed(Query query) {
String statement = query.getStatement();
// Fix: Normalize short queries (starting with 'where', 'order by')
// to full 'select doc.fullName from XWikiDocument doc ...' form
// BEFORE performing safety checks.
if (isShortForm(statement)) {
statement = normalizeToFullQuery(statement);
}
// Perform validation on the fully expanded statement
if (!isSafeSelect(statement)) {
throw new SecurityException("Query is not allowed");
}
}This change eliminates the ambiguity that allowed the parser bypass. By validating the exact string that will be processed by Hibernate, the system ensures that no hidden SQL context escapes remain.
Exploitation relies on sending a crafted GET request to the REST API. The attacker utilizes the q parameter to inject the malicious HQL/SQL payload and sets the type parameter to hql. A typical attack uses a Time-Based Blind SQL Injection vector, where the attacker asks the database to sleep for a specific duration to confirm the injection.
Proof of Concept Payload:
GET /rest/wikis/xwiki/query?q=where%20doc.name=length(%27a%27)*org.apache.logging.log4j.util.Chars.SPACE%20or%201%3C%3E%271%5C%27%27%20union%20select%201,2,3,sleep(7)%20%23%27&type=hql&distinct=0 HTTP/1.1
Host: target-xwiki.example.comPayload Decomposition:
where doc.name=...): This satisfies the parser's requirement for a "short-form" query, engaging the vulnerable code path.1<>'1\'): The sequence 1<>'1\'' is the core of the bypass. It leverages a discrepancy between how the HQL parser and the SQL driver handle escaped quotes. To HQL, this appears to be a comparison involving a string. To the SQL engine, the backslash escapes the quote, closing the string literal early.union select ... sleep(7)): Once the string literal is closed in the generated SQL, the attacker appends a UNION SELECT statement invoking sleep(7). If the server takes 7+ seconds to respond, the vulnerability is confirmed.#): The trailing hash character comments out the rest of the legitimate query generated by Hibernate, preventing syntax errors.The impact of this vulnerability is severe due to the level of access obtained and the lack of authentication required.
Confidentiality (High): Attackers can extract the entire database contents. This includes wiki pages, configuration data, and critically, the xwikiusers table which contains user credentials (password hashes). Access to this table often allows for offline cracking or pass-the-hash attacks to gain administrative access to the application.
Integrity (High): While the PoC demonstrates a SELECT injection, the underlying flaw allows arbitrary SQL execution. Depending on the database user's privileges (often high in default configurations), an attacker could execute UPDATE or DELETE statements. This allows for defacement of the wiki, insertion of malicious JavaScript (XSS) into pages, or the creation of new administrative users.
Availability (High): Attackers can execute resource-intensive queries (e.g., BENCHMARK or long SLEEP commands) that exhaust database connection pools or CPU resources, rendering the XWiki instance unresponsive to legitimate users.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
xwiki-platform XWiki | >= 1.8, < 15.10.16 | 15.10.16 |
xwiki-platform XWiki | >= 16.0.0-rc-1, < 16.4.6 | 16.4.6 |
xwiki-platform XWiki | >= 16.5.0-rc-1, < 16.10.1 | 16.10.1 |
| Attribute | Detail |
|---|---|
| CWE | CWE-89 (SQL Injection) |
| CVSS v3.1 | 9.8 (Critical) |
| Attack Vector | Network (REST API) |
| Privileges Required | None |
| EPSS Score | 0.26184 (96.18%) |
| Exploit Status | PoC Available |
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
CVE-2026-57173 (GHSA-hcwq-8wjf-3gcr) represents a critical resource allocation validation vulnerability in the vLLM inference engine. Prior to version 0.24.0, vLLM's multimodal chat completions pipeline failed to enforce maximum audio decode duration limits. Unauthenticated remote attackers can exploit this to perform an audio decompression bomb attack, causing massive memory allocations that trigger immediate system Out-Of-Memory (OOM) crashes and service termination.
Grav CMS before v2.0.1 contains a security bypass vulnerability in its blueprint validation logic. The XSS detection routine, Security::detectXss(), was executed on raw page contents prior to Twig engine processing. When Twig processing is enabled for editor-authored page content, an attacker can dynamically reconstruct harmful HTML elements, attributes, or protocols using string concatenation (e.g. `{{ 'on' ~ 'error' }}`). When compiled, the benign source converts into active XSS payloads, which are rendered to the client browser via raw filters. This vulnerability was resolved in version 2.0.1 by adding a post-render validation backstop.
An OAuth resource spoofing vulnerability in the rmcp crate prior to 2.0.0 allows a malicious Model Context Protocol (MCP) server to spoof protected resource metadata. By presenting metadata pointing to a legitimate resource and authorization server, the attacker can trick the client into completing the authentication flow and subsequently sending the authorized token back to the malicious server.
CVE-2026-63128 is a high-severity uncontrolled resource consumption vulnerability in the Model Context Protocol (MCP) official Rust SDK (the rmcp crate) prior to version 2.0.0. An unauthenticated attacker can exploit this vulnerability by sending malformed or mismatching handshake requests to the stateful Streamable HTTP server, causing persistent memory allocation without cleanup. This results in an unbounded memory leak and lock contention that ultimately leads to complete denial of service.
A cross-site scripting (XSS) vulnerability was identified in @nuxtjs/mdc prior to version 0.22.1. Gaps in the HTML/SVG attribute verification and URL protocol parsing allow unauthenticated remote attackers to bypass the application's sanitization routines. By embedding malicious SVG links or data-encoded iframe elements within Markdown, attackers can execute arbitrary JavaScript in the victim's browser context.
CVE-2026-58657 is a critical stored CSS injection vulnerability in Grav CMS's media processing pipeline. By exploiting improper sanitization of image dimensions in the resize helper, low-privileged users with page editing permissions can inject arbitrary CSS styles. This can lead to visual defacement, UI redressing, and indirect data exfiltration.