Low-privilege database accounts can trigger remote code execution in major engines
Researcher Zheng Yu demonstrates how memory-corruption bugs in PostgreSQL, MySQL, Oracle, and ClickHouse allow low-privilege or unauthenticated users to execute code on the server.
Security researcher Zheng Yu has published proof-of-concept exploits showing that low-privilege database accounts can achieve remote code execution (RCE) on servers running PostgreSQL, MySQL, ClickHouse, and Oracle. The research, released by Depthfirst, highlights how memory-corruption vulnerabilities in the underlying engine code can be triggered through standard SQL operations, bypassing traditional table-level access controls. While no active attacks have been observed, the findings underscore a critical gap between logical database permissions and memory safety in these widely used systems.
What happened
Zheng Yu demonstrated that database accounts with minimal privileges, such as the ability to create temporary tables or objects, can exploit memory-unsafe C and C++ code within the database engines. In PostgreSQL, an account with the default TEMPORARY privilege was able to leverage a type-confusion bug to execute code as the operating system user running the database. This flaw, tracked as CVE-2026-116331, allows an attacker to build objects in a temporary schema without accessing any application data, eventually gaining full server control. The vulnerability was patched in mid-November 2026.
Similar issues were identified in MySQL and ClickHouse. In MySQL, a flaw in the query optimizer (CVE-2026-101786) allowed an account with only temporary table creation rights to execute code, contradicting Oracle’s initial assessment that high privileges were required. For ClickHouse, an integer-overflow write vulnerability was triggered by setting a specific binary format option to zero, leading to shell access on version 26.7.5.10. Oracle Database presented a distinct threat vector: a chain of bugs in Oracle Text and the GraphQL interface of Oracle REST Data Services allowed unauthenticated attackers to execute commands via exposed web endpoints, bypassing login requirements entirely.
How it works
The core mechanism relies on the separation between SQL-level permissions and the memory management of the database engine. SQL permissions dictate which tables and schemas a user can read or write, but they do not restrict the engine’s internal C and C++ code from processing maliciously crafted inputs. When a user performs allowed actions, such as creating a temporary table or submitting a query, the engine processes this input in memory. If the engine contains memory-corruption bugs like type confusion or integer overflows, carefully structured inputs can corrupt memory state and redirect execution flow to attacker-controlled code.
In the case of Oracle, the attack does not require a database account. Instead, it chains two separate vulnerabilities: one in Oracle Text and another in the GraphQL interface of Oracle REST Data Services. By targeting an exposed web endpoint, an attacker can reach the engine code directly. This path bypasses authentication entirely, allowing command execution before any login occurs. For the other databases, the attacker needs a valid login but only requires minimal privileges, such as the right to create temporary objects, which are often granted by default.
Key details
- PostgreSQL CVE-2026-116331 affects versions before 18.7, 17.12, 16.16, 15.20, and 14.25, fixed November 12, 2026.
- MySQL CVE-2026-101786 impacts Server and Cluster versions 26.7.0 to 26.7.1, fixed October 20, 2026.
- Oracle Database CVE-2026-114819 (Oracle Text) affects multiple versions up to 23.26.3, fixed November 17, 2026, with a severity rating of 9.9.
- Oracle REST Data Services CVE-2026-91609 affects versions 24.2.0 to 26.2.1, fixed October 20, 2026.
- ClickHouse vulnerability has no CVE; fixes were released in September 2026 for versions 26.9 and later, with backports to earlier lines.
- None of the exploits have been observed in real-world attacks, and independent reproduction of the full attack chains has not been reported.
Why it matters
For software engineers and infrastructure leads, this research challenges the assumption that restricting table access is sufficient for database security. Many organizations rely on least-privilege principles at the SQL level, assuming that users who cannot read sensitive data pose little risk. However, these exploits show that even read-only or limited-write accounts can compromise the host server if the engine itself is vulnerable. This shifts the focus from just data access controls to the integrity of the database software and its configuration.
The Oracle finding is particularly concerning for teams exposing database services via web interfaces. Since the attack requires no authentication, any publicly accessible Oracle REST endpoint could be a gateway for server compromise. This highlights the importance of network segmentation and rigorous patching for components that bridge web traffic and database engines. Teams must now consider not just what users can see, but what actions they can trigger in the engine’s memory space.
What you can do
- Apply all vendor patches immediately, specifically targeting the CVEs listed for PostgreSQL, MySQL, and Oracle, and update ClickHouse to version 26.9 or the relevant backported build.
- Review database user privileges and revoke the TEMPORARY privilege or temporary table creation rights from accounts that do not explicitly need them.
- Audit Oracle REST Data Services endpoints to ensure they are not exposed to untrusted networks without additional authentication layers.
- Monitor for unusual process creation or shell activity on database servers, as indicators of potential exploitation.
- Verify that your MySQL and ClickHouse versions are not among the affected releases, even if you believe your usage patterns are low-risk.
- Consider implementing network-level restrictions to limit which IPs can connect to database ports and web interfaces.



