TLS Compression Enabled (CRIME)

The service supports TLS-level compression, which lets an attacker who can observe traffic and influence requests recover secrets such as session cookies (the CRIME attack).

SeverityLow
CVSS 3.13.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N Open in the calculator
CVSS 4.02.3 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-203: Observable Discrepancy
MITRE ATT&CKT1539 Steal Web Session Cookie, T1557 Adversary-in-the-Middle
CVECVE-2012-4929
CategoryCryptographic Failures

Description

The service accepts TLS-level compression, which compresses data before it is encrypted. Compression shortens repeated text, so when a secret such as a session cookie is compressed together with data an attacker can influence, the length of the encrypted record reveals whether the attacker's guess matches part of the secret. The CRIME attack, published in 2012 (CVE-2012-4929), uses this to recover a cookie a few characters at a time: the attacker makes the victim's browser send many requests with chosen content, typically through script on a page the victim visits, and watches the size of the resulting encrypted records. Secrets carried in the compressed data, such as session cookies or authorisation headers, can be recovered in this way and used to take over the victim's session.

Browsers disabled TLS compression in response to the attack, and TLS 1.3 removed it, so a connection is only compressed when the client also offers compression, as some older libraries and non-browser clients do. Since the attack also needs both a network position from which to observe the encrypted traffic and a way to drive the victim's requests, the practical exposure is small and limited to those older or non-browser clients. Server support usually indicates an old TLS library or a configuration that explicitly enables it.

The issue is shown by testssl.sh, which reports CRIME, and by vulnerability scanners; openssl s_client reports the compression method negotiated, provided the client build itself offers compression. A related attack, BREACH, uses HTTP-level compression of response bodies and is not prevented by disabling TLS compression.

Remediation

Disable TLS compression on the service:

  • In Apache httpd, set SSLCompression off, which is the default in current releases.
  • In software built on OpenSSL, set the SSL_OP_NO_COMPRESSION option, or upgrade to a current OpenSSL release, in which compression is disabled by default and is only available in builds that explicitly enable it.
  • For nginx, appliances and other software with no setting for it, upgrade to a release that disables TLS compression.
  • Enable TLS 1.3, which has no compression, and remove deprecated protocol versions.

Disabling TLS compression does not address HTTP response compression; where responses that contain secrets are compressed, assess the BREACH attack separately. Confirm the fix with testssl.sh, or with an openssl s_client build that offers compression, checking that no compression is negotiated.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More TLS and Certificates Findings

Every TLS and Certificates finding