CVE-2010-0731: Buffer Overflow
During the testing of GnuTLS updates, a flaw was discovered affecting Red Hat Enterprise Linux 4 GnuTLS packages on s390x platform, causing gnutls-cli to crash while printing server certificate info.
This crash was caused by a flaw in gnutlsx509crtgetserial(), which calls asn1readvalue() to extract serial number from the x509 certificate.
(lib/x509/x509.c) 526 int gnutlsx509crtgetserial(gnutlsx509crt cert, void result, 527 sizet resultsize) 528 { ... 536 if ((ret = asn1readvalue(cert->cert, "tbsCertificate.serialNumber", result, resultsize)) < 0) {
asn1readvalue() expects pointer to int (32 bit) as its third argument, but gnutlsx509crtgetserial() passed pointer to sizet (64 bit on 64 bit platforms) instead. On 64bit big endian platforms asn1readvalue() got incorrect length value.
(lib/minitasn1/element.c) 598 asn1retCode 599 asn1readvalue(nodeasn root,const char name,void ivalue, int len)
On little endian 64 bit platforms, high 32 bits of the resultsize sizet value were lost, but they only contained zeros. On big endian 64 bit platforms, low 32 bits were lost / ignored, causing asn1readvalue() to see length value as 0. This caused asn1readvalue() to return an error, but the length of the value that should have been extracted was saved to len.
gnutlsx509crtgetserial() did not correctly check return value of asn1readvalue(), failing to detect an error. After returning, caller could see a high value stored in resultsize (when interpreted as 64 bit value again).
printx509info() (used by gnutls-cli or gnutls-serv) and printcertificateinfo() (used by certtool) relied on the returned size value. Unexpected value caused a stack buffer overflow in those functions.
This bug could also cause gnutlsx509crtcheckrevocation() to incorrectly check supplied X509 certificate against the list of revoked certificates, resulting in a bypass or the CRL check.
This issue was fixed upstream via following commit: http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=112d537d
This fix was first included in upstream version 1.2.1. Therefore, GnuTLS packages in Red Hat Enterprise Linux 5, Fedora, and current upstream GnuTLS versions are not affected by this flaw.
Other sources
The gnutlsx509crtgetserial function in the GnuTLS library before 1.2.1, when running on big-endian, 64-bit platforms, calls the asn1readvalue with a pointer to the wrong data type and the wrong length value, which allows remote attackers to bypass the certificate revocation list (CRL) check and cause a stack-based buffer overflow via a crafted X.509 certificate, related to extraction of a serial number.
— MITRE
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2010-0731?
CVE-2010-0731 is considered a medium severity vulnerability as it leads to a crash of the gnutls-cli tool.
How do I fix CVE-2010-0731?
To fix CVE-2010-0731, update the GnuTLS packages to version 1.2.0 or later on affected systems.
Which platforms are affected by CVE-2010-0731?
The CVE-2010-0731 vulnerability specifically affects the Red Hat Enterprise Linux 4 GnuTLS packages on the s390x platform.
What component is impacted by CVE-2010-0731?
CVE-2010-0731 impacts the gnutls_x509_crt_get_serial() function in GnuTLS when it attempts to read server certificate information.
Can CVE-2010-0731 lead to data exposure?
CVE-2010-0731 does not directly result in data exposure but may lead to denial of service due to application crashes.