This issue requires an assignee. Since you haven't specified one, we've assigned TestManager as the default assignee for this issue.


Welcome To openGauss Community
Hey @fang_erj , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
Contact Guide
If you have any questions, please contact the SIG: StorageEngine, AI, CM, CloudNative, SecurityTechnology, SQLEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @libiao2024, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @Igali, @bihua111, @cailei19, @h_ray, @levy53071, @libiao2024, @lihaixiao, @mrzack, @wangfeihuo, @wuyuechuan, @xiong_xjun, @zhangfengzhi123, @zhangxubo, @zhangzq131, @zjh_hw .


B023验证:
不会有element数组越界写



回归时间:2026.9.14
回归版本:7.0.0 B023
回归结论:通过
回归步骤:按上述步骤执行SQL语句
select ('{' || string_agg(i||':1',',' order by i )||'}/20000')::sparsevec from generate_series(1,20000) as i;



8.0.0B001版本自验证:



回归时间:2026.10.12
回归版本:8.0.0 B001
回归结论:通过
回归步骤:按上述步骤执行SQL语句



测试类型
安全
测试版本
7.0.0-RC2
问题描述
openGauss 的
sparsevec类型文本输入函数sparsevec_in(src/common/backend/utils/adt/sparsevec.cpp)存在堆缓冲区溢出(越界写)。任意具有连接权限的数据库用户,通过 一条 SQL 语句 即可触发,导致内存破坏 / 服务进程中止(远程可达的拒绝服务 DoS)。sparsevec_in中临时数组elements的大小与溢出保护使用不一致的表达式:elements = palloc(Min(maxNnz, SPARSEVEC_MAX_NNZ) * sizeof(...)),上限 16000 条目(第 201 行)if (nnz == maxNnz),使用 未封顶 的maxNnz(逗号数 + 1,此处为 20000)(第 227 行)当非零元素 > 16000 时,
nnz越过 16000 不会触发保护,elements[16000]越界写(第 291 行)。操作系统和硬件信息
测试环境
轻量版服务器安装
被测功能
预置条件
无
操作步骤
客户端链接并执行:
SELECT '{1:1,2:1,...,20000:1}/20000'::sparsevec;预期输出
正常接受执行或报错返回
实际输出
连接断开、整个服务器被中止(openGauss 为线程模型,单条连接即可令整库退出)。
日志信息
提单组织
社区用户
测试代码