TALOS-2025-2140 || Cisco Talos情报组 - 全面威胁情报
Dell BSAFE Crypto-C _A_DecodeType 越界读取漏洞
发布日期:2025年10月16日
CVE编号:CVE-2019-3728
摘要
Dell BSAFE Crypto-C xxx版本的_A_DecodeType功能中存在整数溢出漏洞。特制的ASN.1记录可导致越界读取。攻击者可通过提供畸形的ASN.1记录来触发此漏洞。
确认受影响的版本
以下版本经过Talos测试或验证,或由供应商确认为易受攻击:
- Dell BSAFE Crypto-C RSA 6.4
产品链接
BSAFE Crypto-C - https://www.dell.com/support/product-details/en-us/product/bsafe-crypto-c-micro-edition/docs
CVSSv3评分
7.5 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CWE
CWE-190 - 整数溢出或回绕
详细说明
Dell BSAFE Crypto-C是一个为应用程序开发者提供加密功能和服务的软件库。它是BSAFE安全产品套件的一部分,旨在提供强大的加密和数据保护能力。Crypto-C支持广泛的加密算法,包括对称和非对称加密、哈希和数字签名,确保安全的数据处理和通信。
在_A_DecodeType中存在整数溢出漏洞。我们可以在getRSAPublicModLen中看到这个易受攻击函数的使用,它最终调用GetIndefiniteElementLen,该函数包含以下循环:
1
2
3
4
5
6
7
|
Line 1 for (i = 0; !(contents.data[i] == 0 && contents.data[i + 1] == 0);
Line 2 i += subElementLen) {
Line 3 if ((status = _A_GetIndefiniteElementLen
Line 4 (&subElementLen, contents.data + i, maxLen - (i + extraBytes))) != 0)
Line 5 return status;
Line 6
Line 7 }
|
GetIndefiniteElementLen可以通过调用_A_DecodeType来更新subElementLen,源代码如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
Line 100 int _A_DecodeType(unsigned int *encodingLen, unsigned int *type,
Line 101 unsigned int *extendedTagLen, ITEM *contents, byte *encoding,
Line 102 unsigned int maxLen)
Line 103
Line 104 {
Line 105
Line 106 ...
Line 107
Line 108 else if (sizeof(unsigned int) >= 4 && lengthOctets[0] == 0x84)
Line 109 {
Line 110 if (maxLen < *extendedTagLen + 6)
Line 111 /* Not enough bytes to read the length. */
Line 112 return (ASNE_InputLen);
Line 113
Line 114 contents->len = ((unsigned int)lengthOctets[1] << 24) |
Line 115 ((unsigned int)lengthOctets[2] << 16) |
Line 116 ((unsigned int)lengthOctets[3] << 8) |
Line 117 (unsigned int)lengthOctets[4];
Line 118 *encodingLen = 6 + contents->len + *extendedTagLen;
Line 119 contents->data = lengthOctets + 5;
Line 120
Line 121 }
Line 122 ...
Line 123 if (*encodingLen > maxLen)
Line 124 return (ASNE_InputLen);
|
畸形的ASN数据可以指定一个较大的len值,导致第118行表达式中的整数溢出。这随后在执行i += subElementLen和!contents.data[i] == 0时导致越界读取。
如果攻击者成功,他们可以利用泄露的内存来绕过ASLR,并结合其他漏洞获得执行任意代码的能力。
供应商响应
供应商信息:https://www.dell.com/support/kbdoc/en-us/000205186/bsafe-crypto-c-micro-edition-sdk-end-of-life-announcement
时间线
- 2025年1月24日 - 向供应商披露
- 2025年10月8日 - 供应商发布补丁
- 2025年10月16日 - 公开披露
致谢
Jason Crowder