Support option to disable TLS compression to protect against CRIME attack

Bug #1068854 reported by Reed Loden on 2012-10-19
288
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Apache2 Web Server
Unknown
Unknown
apache2 (Debian)
Fix Released
Unknown
apache2 (Fedora)
Fix Released
Medium
apache2 (Ubuntu)
Undecided
Unassigned

Bug Description

Upstream Apache recently committed a change to be in Apache 2.2.24 (not yet released) that would allow for disabling TLS compression to protect against the CRIME attack. As it's probably going to be a way before 2.2.24 is released, it would be great to backport this patch as a one-off SRU to at least precise (LTS) and quantal until the new release. There's also been some mention that supporting TLS compression is possibly causing some people's PCI compliance tests to fail, so having this option would be extremely useful to help pass their compliance tests (plus just protecting against CRIME and CRIME-like attacks).

More info:
https://issues.apache.org/bugzilla/show_bug.cgi?id=53219
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674142
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689936
https://community.qualys.com/blogs/securitylabs/2012/09/14/crime-information-leakage-attack-against-ssltls
http://isecpartners.com/blog/2012/9/14/details-on-the-crime-attack.html

CVE References

Juliano Rizzo and Thai Duong, researches that reported BEAST (Browser Exploit Against SSL/TLS, bug #737506) attack announced they are planning to disclose another attack against SSL/TLS named CRIME. The issue is planned to be presented by them on the ekoparty 2012 conference.

http://www.ekoparty.org/2012/juliano-rizzo.php
http://www.ekoparty.org/2012/thai-duong.php
http://www.h-online.com/security/news/item/BEAST-creators-develop-new-SSL-attack-1702136.html
http://threatpost.com/en_us/blogs/new-attack-uses-ssltls-information-leak-hijack-https-sessions-090512

After the announcement of the upcoming presentation of CRIME, researches started to investigate what the issue used by CRIME may be, resulting in publication attack taking advantage of information leak resulting from the use of compression in the SSL/TLS, such as following write-up from Thomas Pornin:

http://security.blogoverflow.com/2012/09/how-can-you-protect-yourself-from-crime-beasts-successor/

Several additional resources now confirm that the CRIME attack is the same as the problem identified by Thomas Pornin, and explain the meaning of CRIME abbreviation as "Compression Ratio Info-leak Made Easy":

http://arstechnica.com/security/2012/09/crime-hijacks-https-sessions/
http://www.youtube.com/watch?v=gGPhHYyg9r4
http://thread.gmane.org/gmane.network.gnutls.general/2887

In addition to zlib/deflate compression used by SSL/TLS, another attack vector using SPDY protocol with compression over non-compressed SSL/TLS connection is mentioned.

Also the following research paper form 2002 was pointed out, which discusses similar problems in the use of compression in SSL/TLS:

http://www.iacr.org/cryptodb/data/paper.php?pubkey=3091

GNUTLS-SA-2012-4 notes the CRIME attack:

http://www.gnu.org/software/gnutls/security.html

and indicates that GnuTLS does not enable compression by default. It also indicates that if compression is enabled, use the CBC ciphers which, while not mitigating the attack, make it substantially harder to succeed.

Red Hat Enterprise Linux 5 and 6 currently contain Mozilla Firefox version 10.0.x ESR. Those versions:

- do not request the use of zlib compression in the SSL/TLS protocol
- do not support SPDY protocol

Therefore, they are not affected by either of the published attack vectors.

The support for SPDY protocol was added upstream in Firefox version 11, and only enabled by default in version 13. Version 15 disables SPDY protocol compression.

http://www.mozilla.org/en-US/firefox/11.0/releasenotes/
https://hacks.mozilla.org/2012/02/spdy-brings-responsive-and-scalable-transport-to-firefox-11/
http://www.mozilla.org/en-US/firefox/13.0/releasenotes/

OpenSSL enables zlib compression by default for both clients and servers starting with version 0.9.8:

http://cvs.openssl.org/chngview?cn=9594

The openssl packages in Red Hat Enterprise Linux 5 (starting with RHBA-2009:0181 update released in Red Hat Enterprise Linux 5.3) and 6, and also in Fedora, contain a patch that makes the library check if OPENSSL_NO_DEFAULT_ZLIB environment variable is set (can have arbitrary value, even empty string) and disable the default zlib support.

http://pkgs.fedoraproject.org/cgit/openssl.git/tree/openssl-0.9.8j-env-nozlib.patch?id=1d20b5f2

Setting the OPENSSL_NO_DEFAULT_ZLIB environment variable before starting a client or a server application using OpenSSL can be used to disable zlib compression support and hence mitigate this flaw. For example, httpd with mod_ssl has compression enabled by default in Red Hat Enterprise Linux 5 and 6, and hence it is used when client also supports it. Adding the following line to the /etc/sysconfig/httpd file:

  export OPENSSL_NO_DEFAULT_ZLIB=1

and restarting the httpd service disables the use of SSL/TLS compression in mod_ssl and the compression will not be negotiated even when connecting client supports it. Note that this environment variable only affects the use of SSL/TLS protocol compression and does not affect the use of HTTP protocol compression implemented by the mod_deflate module.

The openssl packages in Red Hat Enterprise Linux 3 and 4 are based on upstream version 0.9.7a and do not enable SSL/TLS zlib compression.

Network Security Services (NSS) library, also used by Mozilla Firefox, does not enable zlib compression by default. The use of httpd with mod_nss on Red Hat Enterprise Linux 5 and 6 is not affected by this issue.

Following CVE ids were assigned to this issue:

CVE-2012-4929 - for the SSL/TLS zlib/deflate attack variant
CVE-2012-4930 - the the SPDY over SSL/TLS connection without compression, now tracked via separate bug 857737

Mozilla assigned CVE-2012-3977 to the SPDY flaw in Firefox and Seamonkey. The CVE is being tracked via the bug #859827.

(In reply to comment #5)
...
> Adding the following line to the /etc/sysconfig/httpd file:
>
> export OPENSSL_NO_DEFAULT_ZLIB=1

But there are other services but http that use ssl and are vulnerable?
Where to set this environment variable system wide?

There is no definitive place where to set environment variables system wide. The reason is that various services clean up their environment variable list when executing other binaries. For example the environment variables are reset when login process is running the user's shell on login.

Apache httpd web server mod_ssl module upstream bug:
  https://issues.apache.org/bugzilla/show_bug.cgi?id=53219

Relevant commits to disable TLS-level compression:
http://svn.apache.org/viewvc?view=revision&revision=1345319 (against trunk)
http://svn.apache.org/viewvc?view=revision&revision=1369585 (against 2.4.x branch)

(In reply to comment #14)
> Apache httpd web server mod_ssl module upstream bug:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=53219

Note that the SSLCompession configuration option was not added in response to CRIME, but was requested and implemented earlier. Also see comment #5 that describes workaround that can be used for httpd / mod_ssl in existing Red Hat Enterprise Linux version without further changes.

Reed Loden (reed) wrote :

Note that Red Hat already supports a workaround [0] that allows for disabling zlib at the OpenSSL layer, which prevents TLS compression working in Apache. As far as I am aware, no such option exists for Ubuntu, leaving users vulnerable until a new package is available.

[0] https://bugzilla.redhat.com/show_bug.cgi?id=857051#c5

Robie Basak (racb) on 2012-10-21
information type: Public → Public Security
Changed in apache2 (Debian):
status: Unknown → Confirmed
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apache2 (Ubuntu):
status: New → Confirmed
Changed in apache2 (Debian):
status: Confirmed → Fix Released
Reed Loden (reed) wrote :

Debian just released apache2 v2.2.22-12 to address this issue.

Changed in apache2 (Ubuntu):
status: Confirmed → Fix Released
Reed Loden (reed) wrote :

Virendra, as far as I know, this isn't in any released Apache version.

Changed in apache2 (Ubuntu):
status: Fix Released → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apache2 - 2.2.8-1ubuntu0.24

---------------
apache2 (2.2.8-1ubuntu0.24) hardy-security; urgency=low

  * SECURITY UPDATE: XSS vulnerability in mod_negotiation
    - debian/patches/224_CVE-2012-2687.dpatch: escape filenames in
      modules/mappers/mod_negotiation.c.
    - CVE-2012-2687
  * SECURITY UPDATE: CRIME attack ssl attack (LP: #1068854)
    - debian/patches/225_CVE-2012-4929.dpatch: backport SSLCompression
      on|off directive. Defaults to off as enabling compression enables the
      CRIME attack.
    - CVE-2012-4929
 -- Marc Deslauriers <email address hidden> Tue, 06 Nov 2012 15:01:07 -0500

Changed in apache2 (Ubuntu):
status: Confirmed → Fix Released

Created openssl tracking bugs for this issue

Affects: fedora-all [bug 886173]

This issue has been addressed in following products:

  Red Hat Enterprise Linux 5
  Red Hat Enterprise Linux 6

Via RHSA-2013:0587 https://rhn.redhat.com/errata/RHSA-2013-0587.html

(In reply to comment #5)
> The openssl packages in Red Hat Enterprise Linux 5 (starting with
> RHBA-2009:0181 update released in Red Hat Enterprise Linux 5.3) and 6, and
> also in Fedora, contain a patch that makes the library check if
> OPENSSL_NO_DEFAULT_ZLIB environment variable is set (can have arbitrary
> value, even empty string) and disable the default zlib support.

Updated openssl packages from RHSA-2013:0587 (see comment 30 above) do not longer enable zlib compression support by default. Therefore, OPENSSL_NO_DEFAULT_ZLIB environment variable is no longer checked. Instead, they now check for the OPENSSL_DEFAULT_ZLIB environment variable, which can be used to enable zlib compression support by default.

Created mingw32-openssl tracking bugs for this issue

Affects: epel-5 [bug 920869]

Created mingw-openssl tracking bugs for this issue

Affects: fedora-all [bug 920868]

This issue has been addressed in following products:

  RHEV-H and Agents for RHEL-6

Via RHSA-2013:0636 https://rhn.redhat.com/errata/RHSA-2013-0636.html

OpenSSL packages in Red Hat Enterprise Linux 5 and 6 were updated to no longer enable by default (comment 31).

NSS, GnuTLS, and Java/JSSE packages either do support compression, or do not enable it by default (see comments above).

OpenSSL packages included in JBoss product versions for non-RHEL platforms (Windows, Solaris) are not built with zlib support and hence were not affected by this problem.

This issue has been addressed in following products:

  RHEV Manager version 3.3

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

Changed in apache2 (Fedora):
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public Security information  Edit
Everyone can see this security related information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.