Bug 520435 (CVE-2009-2700)

Summary: CVE-2009-2700 Qt: QSslCertificate incorrect verification of SSL certificate with NUL in subjectAltName
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: kevin, ltinkl, rdieter, than
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-29 09:12:20 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:
Attachments:
Description Flags
Patch backport to 4.3.5 (from Thiago Macieira)
none
Trivial testing application using QSslSocket none

Description Tomas Hoger 2009-08-31 13:50:06 UTC
A method to bypass SSL certificate name vs. host name verification via NUL
('\0') character embedded in X509 certificate's CommonName or subjectAltName
was presented at Black Hat USA 2009:

http://www.blackhat.com/html/bh-usa-09/bh-usa-09-archives.html#Marlinspike

Similar issues affected Qt's QSslCertificate used by QSslSocket.  This implementation was not affected by problem with NUL characters in CommonName:

http://qt.gitorious.org/qt/qt/commit/41d27eac40cecbc0067be9622c9bc1c579582a47

But the problem existed in handling of subjectAltNames:

http://qt.gitorious.org/qt/qt/commit/802d8c02eaa0aa9cd8d0c6cbd18cd814e6337bc6

Issue is fixed in upstream git, fix will be included in next scheduled Qt update.

Comment 1 Tomas Hoger 2009-08-31 13:52:18 UTC
Created attachment 359259 [details]
Patch backport to 4.3.5 (from Thiago Macieira)

Fix for recent Qt versions can be obtained from the git link referenced above, Thiago Macieira also provided backport for Qt 4.3.5 (we're unlikely to need it).

Comment 2 Tomas Hoger 2009-08-31 13:55:54 UTC
Due to the way Qt handles '*' wild card in certificates (it is allowed to match more than one host name component, even whole host name), certificate with subjectAltName as: *\0.whatever.com is a "universal" certificate as described in Moxies presentation (i.e. is treated as valid for any host name).

Upstream bug to track future changes to the way this wild card is handled:

http://qt.nokia.com/developer/task-tracker/?method=entry&id=260103

Comment 3 Tomas Hoger 2009-08-31 13:58:42 UTC
Created attachment 359261 [details]
Trivial testing application using QSslSocket

Testing certificates are available at:

  http://people.redhat.com/thoger/certs-with-nuls/

Comment 4 Tomas Hoger 2009-08-31 13:59:33 UTC
QSsl* classes were introduced in Qt 4.3, so this issue did not affect Qt versions as shipped in Red Hat Enterprise Linux 3, 4 and 5.

Comment 5 Than Ngo 2009-08-31 14:55:33 UTC
the fix is now included qt-4_5_2-13_fc12 in rawhide, it will be also added in qt for F10/F11 soon.

Comment 6 Fedora Update System 2009-09-03 00:28:55 UTC
qt-4.5.2-3.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2009-09-03 00:29:05 UTC
qt-4.5.2-3.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Tomas Hoger 2010-09-13 08:41:52 UTC
(In reply to comment #2)
> Upstream bug to track future changes to the way this wild card is handled:
> 
> http://qt.nokia.com/developer/task-tracker/?method=entry&id=260103

This is known as QTBUG-4455 in the new Qt bug tracker:
  http://bugreports.qt.nokia.com/browse/QTBUG-4455

Fixed in:
  http://qt.gitorious.org/qt/qt/commit/5f6018564668d368f75e431c4cdac88d7421cff0