May 21, 2026·5 min read·647 visits
Unauthenticated SQL injection in Drupal Core's PostgreSQL driver allows full database compromise and potential remote code execution via crafted JSON:API or search queries.
Drupal Core contains a highly critical SQL injection vulnerability (CVE-2026-9082) within its Database Abstraction API. The flaw specifically affects installations using the PostgreSQL database backend, allowing unauthenticated attackers to execute arbitrary SQL commands via crafted array keys in filter parameters.
CVE-2026-9082 is an unauthenticated SQL Injection (CWE-89) vulnerability residing within the core architecture of Drupal. It specifically affects installations utilizing the PostgreSQL database backend. Deployments running MySQL, MariaDB, and SQLite remain unaffected by this specific attack vector due to differences in database driver implementation and syntax handling.
The flaw originates in the Database Abstraction API, particularly in how the PostgreSQL driver processes structural query components. While Drupal reliably sanitizes parameter values using prepared statements, it relies on its internal query builder to handle field names, operators, and ordering clauses. This structural construction process fails to adequately validate input derived from array keys.
Attackers exploit this validation failure by passing crafted array keys within filter parameters via standard endpoints, such as JSON:API or Core Search. The system incorporates these keys into the final SQL string without sufficient neutralization. This allows malicious actors to break out of the intended query structure and append arbitrary PostgreSQL commands.
The root cause of CVE-2026-9082 is the improper neutralization of special elements within array keys processed by the PostgreSQL database driver. Drupal’s abstraction layer separates data values from SQL structures to prevent injection. However, filter conditions constructed via JSON:API or Entity Queries dynamically build query clauses based on user-supplied parameter keys.
When an attacker provides a crafted key, the validation logic fails to detect PostgreSQL-specific operators. Specifically, type casting operators (::), string concatenation operators (||), and dollar-quoting mechanisms bypass the standard alphanumeric filters intended for column identifiers. The driver assumes these keys represent legitimate, safe structural components.
Because the driver directly concatenates these unsanitized keys into the SQL statement, the injected characters alter the syntax tree of the resulting query. The database engine executes the concatenated string, processing the attacker's payload as legitimate SQL commands rather than literal identifiers. This failure sequence effectively negates the protections offered by the prepared statement implementation.
Exploitation requires no authentication and relies on sending crafted HTTP GET requests to specific Drupal endpoints. The primary attack surfaces include the JSON:API (/jsonapi/node/article), Core Search (/search/node), and Views AJAX (/views/ajax) endpoints. These routes natively accept complex, nested array parameters for filtering and sorting operations, providing an ideal injection conduit.
Attackers typically initiate the exploit using a time-based blind SQL injection technique. By injecting the pg_sleep() function into a search parameter, the attacker verifies the vulnerability based on the server's response time. Passing a payload such as keys=test';select pg_sleep(5)-- forces the database to pause execution, providing binary confirmation of the injection point.
If the database user configured in Drupal's settings.php possesses superuser privileges, the attack escalates to Remote Code Execution (RCE). The attacker leverages the PostgreSQL COPY FROM PROGRAM command. This instructs the database engine to execute a shell command on the underlying host operating system and pipe the output into a database table.
A conceptual payload for RCE involves closing the existing query context, executing a UNION SELECT to balance the statement, and chaining the COPY command. The payload test' UNION SELECT null,null; CREATE TABLE cmd_out(output TEXT); COPY cmd_out FROM PROGRAM 'id'; -- demonstrates this exact escalation path.
The vulnerability carries a Drupal Security Risk Score of 20 out of 25, classifying it as Highly Critical. This rating reflects the unauthenticated nature of the attack and the potential for complete database compromise. NVD assigned a CVSS v3.1 base score of 6.5, which measures the direct impacts of standard SQL injection without assuming the presence of a superuser database configuration.
Successful exploitation grants the attacker read and write access to the entire Drupal database. This access enables the exfiltration of sensitive user data, session tokens, and password hashes. Attackers use this access to modify database records, granting administrative privileges to standard user accounts or altering site content.
The impact extends directly to the underlying server infrastructure if the PostgreSQL service runs with elevated privileges. Execution of shell commands via COPY FROM PROGRAM provides a definitive foothold for lateral movement within the network. This highlights the critical importance of adhering to the principle of least privilege when configuring database service accounts.
The primary remediation for CVE-2026-9082 requires updating Drupal Core to a patched version. Administrators must apply version 10.4.10, 10.5.10, 10.6.9, 11.1.10, 11.2.12, or 11.3.10 depending on their active deployment branch. Updates are executed via Composer using the composer update drupal/core drupal/core-recommended command to ensure strict dependency alignment.
As a crucial defense-in-depth measure, administrators must verify the permissions assigned to the PostgreSQL user account connecting to the Drupal database. Ensure this account is strictly prohibited from holding the SUPERUSER role. Restricting database privileges neutralizes the COPY FROM PROGRAM vector, preventing escalation from SQL injection to Remote Code Execution.
Security operations teams should deploy Web Application Firewall (WAF) rules and monitor logs for indicators of compromise. Detection strategies involve searching web access logs for PostgreSQL-specific syntax such as pg_sleep, ::text, and COPY FROM PROGRAM within request parameters. Implementing targeted Sigma rules provides a baseline for identifying these attack patterns in SIEM environments.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Drupal Core Drupal | 8.9.0 - 10.4.9 | 10.4.10 |
Drupal Core Drupal | 10.5.0 - 10.5.9 | 10.5.10 |
Drupal Core Drupal | 10.6.0 - 10.6.8 | 10.6.9 |
Drupal Core Drupal | 11.0.0 - 11.1.9 | 11.1.10 |
Drupal Core Drupal | 11.2.0 - 11.2.11 | 11.2.12 |
Drupal Core Drupal | 11.3.0 - 11.3.9 | 11.3.10 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-89 |
| Attack Vector | Network (Unauthenticated) |
| CVSS v3.1 Score | 6.5 |
| Drupal Risk Score | 20/25 (Highly Critical) |
| Exploit Status | PoC Available |
| KEV Status | Not Listed |
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
SiYuan is a privacy-first personal knowledge management system. In versions prior to v3.7.3, the application fails to apply publish-access filters to the getBacklinkDoc and getBackmentionDoc content endpoints (/api/ref/getBacklinkDoc and /api/ref/getBackmentionDoc). While the corresponding backlink list endpoints correctly filter out publish-forbidden documents, the content endpoints, which are only gated by high-level route authorization checks via CheckAuth, do not. Consequently, a user with low-privilege read access, or an anonymous reader when publish Basic Auth is disabled, can directly invoke these endpoints using a known publish-forbidden document's ID to retrieve its rendered DOM content or determine whether it references a specific target block.
A metadata disclosure vulnerability exists in SiYuan prior to version v3.7.3. The /api/block/getBlockInfo endpoint fails to validate authorization boundaries in publish mode, allowing anonymous readers to access private document metadata.
A critical authorization bypass vulnerability exists in SiYuan personal knowledge management system before v3.7.4. The /api/ref/refreshBacklink endpoint lacks administrative role verification, enabling unauthenticated users to initiate database transactions and disk operations. When combined with an unsafe SQL generation pattern in nested backlink queries, an attacker can exploit a secondary SQL injection vulnerability to compromise local databases or cause denial-of-service conditions.
A critical SQL Injection vulnerability exists in the SiYuan note-taking application (versions <= v3.7.2) due to improper neutralization of single quotes within the backlink and mention search queries. Because the application constructs SQLite Full Text Search (FTS) queries via direct string concatenation and uses a database driver that supports stacked query statements, remote unauthenticated attackers can execute arbitrary SQL commands on the master database, compromising all hosted notebooks. This issue has been fully remediated in version v3.7.4.
CVE-2026-72810 is a critical publish-boundary bypass vulnerability in the SiYuan personal knowledge management system before version 3.7.4. The flaw lies in the backend real-time WebSocket broadcast mechanism. When configured in public publish mode, the system fails to differentiate between unauthenticated public reader sessions and authorized administrative sessions within its global connection pool. This architectural oversight allows unauthenticated remote attackers connecting to the public WebSocket endpoint on port 6808 to passively receive real-time, raw workspace modification events, including keystroke logs, block updates, and content from protected or forbidden documents.
An authentication bypass vulnerability exists in the SiYuan personal knowledge management system (versions <= v3.7.2). The flaw occurs because the kernel's authorization validation handler trusts loopback connection origins blindly, allowing remote network attackers to gain administrative privileges via an exposed local reverse proxy.