{"id":"CVE-2026-111441","state":"PUBLISHED","title":"HLL 反序列化 lenTotal/lenUsed 校验缺失导致堆越界写","description":"在 openGauss-server 的 src/gausskernel/cbb/utils/hll/hll.cpp 中，内置函数 HllObjectUnpack() 存在长度校验缺陷。该函数从用户提供的 packed HLL 解析 lenUsed 与 lenTotal 后，仅检查输入长度足以覆盖 HLL_HEAD_SIZE + lenUsed，随后按 lenTotal 分配缓冲区、按 lenUsed 调用 memcpy_s() 拷贝输入，既未校验 lenTotal >= lenUsed，也将 memcpy_s() 目标大小写成 lenUsed 而非实际分配的 lenTotal，导致安全拷贝无法拦截越界写。hll_in()、hll_print()、hll_cardinality() 等 SQL 入口会走同一解包路径。因此，普通数据库连接用户只需构造 lenTotal 小于 lenUsed 的畸形 packed HLL（例如经 ::hll 进入 hll_in()），即可触发服务端堆越界写，存在内存破坏风险。此问题随 packed HLL 解包函数 HllObjectUnpack() 进入代码，v2.1.0 起即存在。受影响版本包括 2.1.0、3.0.x、3.1.x、5.0.x、5.1.0、6.0.x，以及 7.0.0-RC1、7.0.0-RC2、7.0.0-RC3。该问题已在 7.0.0-LTS 版本修复，通过在 HllObjectUnpack() 中补齐 lenUsed <= lenTotal 校验，并将 memcpy_s() 的目标大小改为实际分配的 lenTotal。修复 PR 见 https://gitcode.com/opengauss/openGauss-server/pull/9380 。","publishedAt":"2026-10-19T02:31:01.069Z","updatedAt":"2026-10-19T17:42:42.026Z","severity":{"score":8.1,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","source":"openGauss"},"assigner":"openGauss","products":["openGauss-server openGauss-server"],"affected":[{"vendor":"openGauss-server","product":"openGauss-server","defaultStatus":"unaffected","versions":[{"version":"7.0.0-LTS","status":"unaffected"}],"platforms":["openEuler Centos"],"collectionURL":"https://opengauss.org/zh/download/archive/?version=7.0.0%20(LTS)"},{"vendor":"openGauss-server","product":"openGauss-server","defaultStatus":"unaffected","versions":[{"version":"7.0.0-RC1, 7.0.0-RC2 7.0.0-RC3","status":"affected"},{"version":"2.1.0","status":"affected"},{"version":"3.0.0-3.0.6","status":"affected"},{"version":"3.1.0","status":"affected"},{"version":"5.0.0-5.0.5","status":"affected"},{"version":"6.0.0-6.0.6","status":"affected"}],"platforms":["openEuler Centos"],"collectionURL":"https://opengauss.org/zh/download/archive/?version=7.0.0-RC3"}],"references":["https://gitcode.com/opengauss/openGauss-server/pull/9380"],"weaknesses":["CWE-122"],"ingestedAt":"2026-10-29T20:10:33.477Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/111xxx/CVE-2026-111441.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-111441","state":"PUBLISHED","datePublished":"2026-10-19T02:31:01.069Z","dateUpdated":"2026-10-19T17:42:42.026Z","assignerShortName":"openGauss","assignerOrgId":"a1a479f7-907b-4ae8-a999-9148cadc9224","dateReserved":"2026-10-16T03:04:58.958Z"},"containers":{"cna":{"title":"HLL 反序列化 lenTotal/lenUsed 校验缺失导致堆越界写","descriptions":[{"lang":"en","value":"在 openGauss-server 的 src/gausskernel/cbb/utils/hll/hll.cpp 中，内置函数 HllObjectUnpack() 存在长度校验缺陷。该函数从用户提供的 packed HLL 解析 lenUsed 与 lenTotal 后，仅检查输入长度足以覆盖 HLL_HEAD_SIZE + lenUsed，随后按 lenTotal 分配缓冲区、按 lenUsed 调用 memcpy_s() 拷贝输入，既未校验 lenTotal >= lenUsed，也将 memcpy_s() 目标大小写成 lenUsed 而非实际分配的 lenTotal，导致安全拷贝无法拦截越界写。hll_in()、hll_print()、hll_cardinality() 等 SQL 入口会走同一解包路径。因此，普通数据库连接用户只需构造 lenTotal 小于 lenUsed 的畸形 packed HLL（例如经 ::hll 进入 hll_in()），即可触发服务端堆越界写，存在内存破坏风险。此问题随 packed HLL 解包函数 HllObjectUnpack() 进入代码，v2.1.0 起即存在。受影响版本包括 2.1.0、3.0.x、3.1.x、5.0.x、5.1.0、6.0.x，以及 7.0.0-RC1、7.0.0-RC2、7.0.0-RC3。该问题已在 7.0.0-LTS 版本修复，通过在 HllObjectUnpack() 中补齐 lenUsed <= lenTotal 校验，并将 memcpy_s() 的目标大小改为实际分配的 lenTotal。修复 PR 见 https://gitcode.com/opengauss/openGauss-server/pull/9380 。"}],"affected":[{"vendor":"openGauss-server","product":"openGauss-server","defaultStatus":"unaffected","versions":[{"version":"7.0.0-LTS","status":"unaffected"}],"platforms":["openEuler Centos"],"collectionURL":"https://opengauss.org/zh/download/archive/?version=7.0.0%20(LTS)"},{"vendor":"openGauss-server","product":"openGauss-server","defaultStatus":"unaffected","versions":[{"version":"7.0.0-RC1, 7.0.0-RC2 7.0.0-RC3","status":"affected"},{"version":"2.1.0","status":"affected"},{"version":"3.0.0-3.0.6","status":"affected"},{"version":"3.1.0","status":"affected"},{"version":"5.0.0-5.0.5","status":"affected"},{"version":"6.0.0-6.0.6","status":"affected"}],"platforms":["openEuler Centos"],"collectionURL":"https://opengauss.org/zh/download/archive/?version=7.0.0-RC3"}],"references":[{"url":"https://gitcode.com/opengauss/openGauss-server/pull/9380"}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV3_1":{"version":"3.1","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"HIGH","availabilityImpact":"HIGH","baseSeverity":"HIGH","baseScore":8.1,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-122","lang":"en","description":"CWE-122 Heap-based buffer overflow","type":"CWE"}]}],"providerMetadata":{"shortName":"openGauss","orgId":"a1a479f7-907b-4ae8-a999-9148cadc9224","dateUpdated":"2026-10-19T02:31:01.069Z"},"impacts":[{"capecId":"CAPEC-100","descriptions":[{"lang":"en","value":"CAPEC-100 Overflow Buffers"}]}],"source":{"discovery":"EXTERNAL"},"x_generator":{"engine":"Vulnogram 1.0.5"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-10-19T17:42:18.566832Z","id":"CVE-2026-111441","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-19T17:42:42.026Z"}}]}}}