CVE-2019-1543: ChaCha20-Poly1305 with long nonces
ChaCha20-Poly1305 is an AEAD cipher, and requires a unique nonce input for every encryption operation. RFC 7539 specifies that the nonce value (IV) should be 96 bits (12 bytes). OpenSSL allows a variable nonce length and front pads the nonce with 0 bytes if it is less than 12 bytes. However it also incorrectly allows a nonce to be set of up to 16 bytes. In this case only the last 12 bytes are significant and any additional leading bytes are ignored. It is a requirement of using this cipher that nonce values are unique. Messages encrypted using a reused nonce value are susceptible to serious confidentiality and integrity attacks. If an application changes the default nonce length to be longer than 12 bytes and then makes a change to the leading bytes of the nonce expecting the new value to be a new unique nonce then such an application could inadvertently encrypt messages with a reused nonce. Additionally the ignored bytes in a long nonce are not covered by the integrity guarantee of this cipher. Any application that relies on the integrity of these ignored leading bytes of a long nonce may be further affected. Any OpenSSL internal use of this cipher, including in SSL/TLS, is safe because no such use sets such a long nonce value. However user applications that use this cipher directly and set a non-default nonce length to be longer than 12 bytes may be vulnerable. OpenSSL versions 1.1.1 and 1.1.0 are affected by this issue. Due to the limited scope of affected deployments this has been assessed as low severity and therefore we are not creating new releases at this time. Fixed in OpenSSL 1.1.1c (Affected 1.1.1-1.1.1b). Fixed in OpenSSL 1.1.0k (Affected 1.1.0-1.1.0j).
Other sources
ChaCha20-Poly1305 is an AEAD cipher, and requires a unique nonce input for every encryption operation. RFC 7539 specifies that the nonce value (IV) should be 96 bits (12 bytes). OpenSSL allows a variable nonce length and front pads the nonce with 0 bytes if it is less than 12 bytes. However it also incorrectly allows a nonce to be set of up to 16 bytes. In this case only the last 12 bytes are significant and any additional leading bytes are ignored. It is a requirement of using this cipher that nonce values are unique. Messages encrypted using a reused nonce value are susceptible to serious confidentiality and integrity attacks. If an application changes the default nonce length to be longer than 12 bytes and then makes a change to the leading bytes of the nonce expecting the new value to be a new unique nonce then such an application could inadvertently encrypt messages with a reused nonce. Additionally the ignored bytes in a long nonce are not covered by the integrity guarantee of this cipher. Any application that relies on the integrity of these ignored leading bytes of a long nonce may be further affected. Any OpenSSL internal use of this cipher, including in SSL/TLS, is safe because no such use sets such a long nonce value. However user applications that use this cipher directly and set a non-default nonce length to be longer than 12 bytes may be vulnerable. OpenSSL versions 1.1.1 and 1.1.0 are affected by this issue. Due to the limited scope of affected deployments this has been assessed as low severity and therefore we are not creating new releases at this time. Fixed in OpenSSL 1.1.1c-dev (Affected 1.1.1-1.1.1b). Fixed in OpenSSL 1.1.0k-dev (Affected 1.1.0-1.1.0j).
Upstream patch:
https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=ee22257b1418438ebaf54df98af4e24f494d1809 https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=f426625b6ae9a7831010750490a5f0ad689c5ba3
References:
https://www.openssl.org/news/secadv/20190306.txt
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/opensslto a version that resolves this vulnerability.Fixed in 1.1.1n-0+deb10u3Fixed in 1.1.1n-0+deb10u6Fixed in 1.1.1w-0+deb11u1Fixed in 1.1.1n-0+deb11u5Fixed in 3.0.11-1~deb12u1Fixed in 3.0.11-1 - Upgrade
Upgrade
redhat/opensslto a version that resolves this vulnerability.Fixed in 1.1.1 - Upgrade
Upgrade
redhat/opensslto a version that resolves this vulnerability.Fixed in 1.1.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.1.0k - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.1.1c - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.1.0k-dev - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.1.1c-dev - Configuration
Ensure that applications using OpenSSL directly configure ChaCha20-Poly1305 to use the RFC 7539 nonce length of 96 bits (12 bytes) and avoid setting a nonce length longer than 12 bytes (which can lead to ignored leading bytes and inadvertent nonce reuse).
OpenSSL ChaCha20-Poly1305 nonce length = set to 12 bytes (96 bits) / do not use a non-default nonce length longer than 12 bytes - Compensating control
If you must use ChaCha20-Poly1305 with a nonce length longer than 12 bytes, treat only the last 12 bytes as significant (front-padded 0 bytes/ignored leading bytes) and ensure uniqueness of those last 12 bytes for every encryption operation.
Event History
Frequently Asked Questions
What is CVE-2019-1543?
CVE-2019-1543 is a vulnerability in OpenSSL that allows a variable nonce length and front pads the nonce with 0 bytes if it is less than 12 bytes.
How does CVE-2019-1543 affect OpenSSL?
CVE-2019-1543 affects OpenSSL versions up to and excluding 1.1.1.
What is the severity of CVE-2019-1543?
CVE-2019-1543 has a severity score of 7.4 (high).
How can I fix CVE-2019-1543?
To fix CVE-2019-1543, update OpenSSL to version 1.1.1 or later.
Where can I find more information about CVE-2019-1543?
You can find more information about CVE-2019-1543 in the references provided: [Link 1](https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=ee22257b1418438ebaf54df98af4e24f494d1809), [Link 2](https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=f426625b6ae9a7831010750490a5f0ad689c5ba3), [Link 3](https://www.openssl.org/news/secadv/20190306.txt).