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 @Wwwing301 , 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 .


20260912 开发自验
memcheck 编译 commit点: 68f12854
连续执行20次
select gs_decrypt_aes128('AAAAAAAAAAAAAAAAAAAAAOKfWT0nb9ND2XUSbCR538QAAQIDBAUGBwgJCgsMDQ4P', 'AttackKeyForOG');
无宕机



验收日期:2026-9-15
验收结论:验收通过
验收版本:7.0.0.B023



测试类型
安全
测试版本
7.0.0LTS
问题描述
基于 openGauss master 提交
f8a1e2d3d0bd1cff05cb2769b509a8ac1ab0f3b1CRYPT_decrypt()解密后会从明文末尾向前查找填充标记。当前游标使用无符号整数,并且没有检查是否已经到达缓冲区开头。如果解密结果全部为
0x00,游标会一直减到 0 以下并变成一个很大的正数;如果明文长度本来就是 0,第一次访问就已经越界。两个输入都能在 AddressSanitizer 下稳定触发越界读。操作系统和硬件信息
Ubuntu 22.04.5 LTS,x86_64,AddressSanitizer/UndefinedBehaviorSanitizer。
测试环境
企业版单机
被测功能
公共密码函数
CRYPT_decrypt()对解密结果的填充处理。本次只运行独立 C++ 最小测试并链接 OpenSSL,没有启动数据库。
预置条件
操作步骤
后两个命令会被 ASan 中止,需要分别执行。
预期输出
有效填充正常解密;空明文、全零明文或找不到填充标记时安全返回错误,不读取缓冲区之外。
实际输出
有效填充对照返回
RET=0 LEN=3,普通错误填充能安全返回错误。全零和零长度两个用例都在以下循环处触发 ASan 越界读:
日志信息
相关代码:
src/common/port/cipher.cpp:1179-1233src/gausskernel/cbb/utils/aes/aes.cpp:571-633src/gausskernel/cbb/utils/aes/cipherfn.cpp:257-340,2222-2307提单组织
社区用户
测试代码