Bug 1101932 (CVE-2014-3466)

Summary: CVE-2014-3466 gnutls: insufficient session id length check in _gnutls_read_server_hello (GNUTLS-SA-2014-3)
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: carnil, chorn, gianluca.varisco, jkurik, jrusnack, ksrot, ktietz, lbopf, magoldma, mattdm, mjc, ngalvin, nmavrogi, pablo.iranzo, patrick.d.mayo, pdwyer, security-response-team, tbowling
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gnutls 3.1.25, gnutls 3.2.15, gnutls 3.3.3 Doc Type: Bug Fix
Doc Text:
A flaw was found in the way GnuTLS parsed session IDs from ServerHello messages of the TLS/SSL handshake. A malicious server could use this flaw to send an excessively long session ID value, which would trigger a buffer overflow in a connecting TLS/SSL client application using GnuTLS, causing the client application to crash or, possibly, execute arbitrary code.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-10 12:29:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1102024, 1102025, 1102027, 1102028, 1102355, 1102356, 1103046, 1103047, 1103048    
Bug Blocks: 1101736    
Attachments:
Description Flags
Patch from Nikos Mavrogiannopoulos none

Description Tomas Hoger 2014-05-28 08:12:50 UTC
A flaw was found in the way GnuTLS parsed session ids from Server Hello packets of the TLS/SSL handshake.  A malicious server could use this flaw to send an excessively long session id value and trigger a buffer overflow in a connecting TLS/SSL client using GnuTLS, causing it to crash or, possibly, execute arbitrary code.

The flaw is in read_server_hello() / _gnutls_read_server_hello(), where session_id_len is checked to not exceed incoming packet size, but not checked to ensure it does not exceed maximum session id length:
https://www.gitorious.org/gnutls/gnutls/source/8d7d6c6:lib/gnutls_handshake.c#L1747

Comment 1 Tomas Hoger 2014-05-28 08:14:20 UTC
Created attachment 899870 [details]
Patch from Nikos Mavrogiannopoulos

Comment 4 Tomas Hoger 2014-05-29 07:41:16 UTC
Acknowledgment:

Red Hat would like to thank GnuTLS upstream for reporting this issue. Upstream acknowledges Joonas Kuorilehto of Codenomicon as the original reporter.

Comment 7 Tomas Hoger 2014-05-30 06:57:05 UTC
Created mingw-gnutls tracking bugs for this issue:

Affects: fedora-all [bug 1103047]

Comment 8 Tomas Hoger 2014-05-30 06:57:08 UTC
Created gnutls tracking bugs for this issue:

Affects: fedora-all [bug 1103046]

Comment 9 Tomas Hoger 2014-05-30 06:57:11 UTC
Created mingw32-gnutls tracking bugs for this issue:

Affects: epel-5 [bug 1103048]

Comment 10 Gianluca Varisco 2014-06-02 06:49:18 UTC
Is 2.12.x also vulnerable?

Comment 11 Gianluca Varisco 2014-06-02 06:50:02 UTC
Err, I meant: 2.x (2.6? 2.8)

Comment 13 Tomas Hoger 2014-06-03 11:31:45 UTC
It seems the issue was first introduced via the following commit:

https://www.gitorious.org/gnutls/gnutls/commit/8a6517a2#lib/gnutls_handshake.c

which pre-dates 1.0.0 by few years.

Comment 14 errata-xmlrpc 2014-06-03 16:09:54 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2014:0595 https://rhn.redhat.com/errata/RHSA-2014-0595.html

Comment 15 errata-xmlrpc 2014-06-03 16:10:33 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2014:0594 https://rhn.redhat.com/errata/RHSA-2014-0594.html

Comment 16 Fedora Update System 2014-06-04 07:53:46 UTC
gnutls-3.1.25-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Vincent Danen 2014-06-04 13:51:32 UTC
IssueDescription:

A flaw was found in the way GnuTLS parsed session IDs from ServerHello messages of the TLS/SSL handshake. A malicious server could use this flaw to send an excessively long session ID value, which would trigger a buffer overflow in a connecting TLS/SSL client application using GnuTLS, causing the client application to crash or, possibly, execute arbitrary code.

Comment 22 Fedora Update System 2014-06-10 03:08:16 UTC
mingw-gnutls-3.1.25-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2014-06-10 03:11:36 UTC
mingw-gnutls-3.1.25-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2014-06-10 03:11:47 UTC
gnutls-3.1.20-5.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 errata-xmlrpc 2014-06-10 12:24:09 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 7

Via RHSA-2014:0684 https://rhn.redhat.com/errata/RHSA-2014-0684.html

Comment 27 errata-xmlrpc 2014-06-30 17:29:08 UTC
This issue has been addressed in following products:

  RHEV-H and Agents for RHEL-6

Via RHSA-2014:0815 https://rhn.redhat.com/errata/RHSA-2014-0815.html