GnuTLS X.509证书序列号解码绕过安全检查漏洞
发布日期:2010-03-25
更新日期:2010-03-30
受影响系统:GNU GnuTLS < 1.2.1
不受影响系统:GNU GnuTLS 1.2.1
描述:
BUGTRAQ ID:
38959
CVE(CAN) ID:
CVE-2010-0731
GnuTLS是用于实现TLS加密协议的函数库。
GnuTLS从X.509证书获取序列号的方式存在漏洞。在64位的big endian平台上,这个漏洞可能允许绕过CRL检查,导致各种GnuTLS工具崩溃或执行任意代码。
漏洞的起因是gnutls_x509_crt_get_serial()函数调用asn1_read_value()从x509证书获取序列号。
(lib/x509/x509.c)
526 int gnutls_x509_crt_get_serial(gnutls_x509_crt cert, void* result,
527 size_t* result_size)
528 {
...
536 if ((ret = asn1_read_value(cert->cert, "tbsCertificate.serialNumber",
result, result_size)) < 0) {
asn1_read_value()预期的是指向int(32位)的指针为第三个参数,但gnutls_x509_crt_get_serial()将指针传送给size_t(64为平台上为64位)。在64位的big endian平台上,
asn1_read_value()获得的是错误的长度值:
(lib/minitasn1/element.c)
598 asn1_retCode
599 asn1_read_value(node_asn *root,const char *name,void* ivalue, int *len)
在little endian的64位平台上,丢失了*result_size size_t值的高32位,但这部分仅包含有0。在big endian的64位平台上,丢失或忽略低32位导致asn1_read_value()判断长度值为0并返回错误,但将应获得的值的长度保存到了*len。
gnutls_x509_crt_get_serial()没有正确的检查asn1_read_value()的返回值,在返回后调用程序可能获得的是*result_size的高位值(在解释为64位值的情况下)。
print_x509_info()和print_certificate_info()依赖于返回的大小值,非预期的值可能会在这些函数中触发栈溢出。
这个bug还可能导致gnutls_x509_crt_check_revocation()无法正确地在已撤销证书列表中检查X509证书,绕过CRL检查。
<*来源:Tomas Hoger (
thoger@redhat.com)
链接:
https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=573028
http://thread.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/4230
https://www.redhat.com/support/errata/RHSA-2010-0167.html
*>
建议:
厂商补丁:
GNU
---
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
http://www.gnu.org/software/gnutls/security.html
RedHat
------
RedHat已经为此发布了一个安全公告(RHSA-2010:0167-01)以及相应补丁:
RHSA-2010:0167-01:Moderate: gnutls security update
链接:
https://www.redhat.com/support/errata/RHSA-2010-0167.html浏览次数:3034
严重程度:0(网友投票)