Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-111441 Overview
CVE-2026-111441 is a heap-based buffer overflow [CWE-122] in the openGauss database server. The flaw resides in the HllObjectUnpack() function in src/gausskernel/cbb/utils/hll/hll.cpp. The function parses lenUsed and lenTotal from user-supplied packed HyperLogLog (HLL) data without validating that lenTotal >= lenUsed. It also passes lenUsed as the destination size to memcpy_s() instead of the actually allocated lenTotal, defeating the safe-copy bounds check. Any authenticated database user can trigger a server-side heap out-of-bounds write by submitting a malformed packed HLL through SQL entry points such as hll_in(), hll_print(), or hll_cardinality().
Critical Impact
An authenticated low-privilege database user can corrupt backend heap memory, leading to database process crash or potential arbitrary code execution in the server process context.
Affected Products
- openGauss-server 2.1.0, 3.0.x, 3.1.x, 5.0.x, 5.1.0, 6.0.x
- openGauss-server 7.0.0-RC1, 7.0.0-RC2, 7.0.0-RC3
- Fixed in openGauss-server 7.0.0-LTS
Discovery Timeline
- 2026-10-19 - CVE-2026-111441 published to NVD
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-111441
Vulnerability Analysis
The HllObjectUnpack() function deserializes packed HLL binary objects supplied by clients. The parser reads two length fields, lenUsed and lenTotal, directly from attacker-controlled bytes. The existing check only verifies that the input buffer is at least HLL_HEAD_SIZE + lenUsed bytes long. The function then allocates a destination buffer of size lenTotal and invokes memcpy_s(dest, lenUsed, src, lenUsed) to copy the payload.
Because both the destination size and copy length passed to memcpy_s() are the same attacker-controlled value, the safe-copy routine cannot detect when lenUsed exceeds the actual allocation lenTotal. The result is a heap write past the end of the allocated chunk. Entry points including hll_in(), hll_print(), and hll_cardinality() all route through this unpack path, so the ::hll cast operator alone is enough to reach the sink.
Root Cause
Two defects combine to produce the overflow. First, HllObjectUnpack() lacks a lenUsed <= lenTotal relational check between the two parsed length fields. Second, the destMax argument to memcpy_s() was mistakenly written as lenUsed rather than the real allocation size lenTotal. The hardened copy function therefore validates the buffer against the same attacker value used as the copy length, nullifying its protection.
Attack Vector
Exploitation requires a valid database login but no elevated role. An attacker crafts a packed HLL blob whose header advertises lenTotal smaller than lenUsed, then injects it through any SQL statement that casts bytes to the hll type. Example payloads reach the server through SELECT '<malicious-bytes>'::hll or inserts into columns of type hll. The server-side parser allocates lenTotal bytes and copies lenUsed bytes into it, overwriting adjacent heap metadata and objects within the backend process.
The vulnerability mechanism and corrective patch are described in the upstream fix at OpenGauss Pull Request #9380.
Detection Methods for CVE-2026-111441
Indicators of Compromise
- Unexpected postgres or gaussdb backend process crashes with SIGSEGV or SIGABRT, especially stack traces referencing HllObjectUnpack or memcpy_s.
- Database audit log entries showing SQL that casts binary literals to the hll type from untrusted sessions.
- Core dumps in the openGauss data directory containing fragments of malformed HLL headers.
Detection Strategies
- Enable openGauss audit logging for DML and function calls involving the hll extension and alert on anomalous ::hll casts.
- Monitor for repeated backend restarts or FATAL log entries from the same client role within short time windows.
- Deploy query-level inspection at the application tier to flag binary HLL inputs whose declared lenTotal is smaller than lenUsed.
Monitoring Recommendations
- Centralize openGauss server logs and correlate crash events with the authenticated user and source address of the preceding session.
- Track memory-related errors emitted by memcpy_s and the memory context allocator in backend logs.
- Review role grants for the hll extension and alert when new users gain execute access to hll_in, hll_print, or hll_cardinality.
How to Mitigate CVE-2026-111441
Immediate Actions Required
- Upgrade openGauss-server to version 7.0.0-LTS, which includes the fix merged in OpenGauss Pull Request #9380.
- Revoke execute privileges on hll_in, hll_print, and hll_cardinality from untrusted roles until patching is complete.
- Audit existing database roles and drop any accounts that do not require interactive SQL access.
Patch Information
The upstream fix adds a lenUsed <= lenTotal validation to HllObjectUnpack() and corrects the destMax argument of memcpy_s() to use the real allocation size lenTotal. The patch is included in openGauss 7.0.0-LTS. Operators running 2.1.0, 3.0.x, 3.1.x, 5.0.x, 5.1.0, 6.0.x, or any 7.0.0-RC build must upgrade.
Workarounds
- If immediate upgrade is not feasible, drop or disable the hll extension in databases that do not require HyperLogLog functionality.
- Restrict network access to the openGauss listener so only trusted application servers can authenticate.
- Enforce least-privilege role design and remove PUBLIC execute grants from HLL input and output functions.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

