Bug 1926226 (CVE-2020-36242) - CVE-2020-36242 python-cryptography: Large inputs for symmetric encryption can trigger integer overflow leading to buffer overflow
Summary: CVE-2020-36242 python-cryptography: Large inputs for symmetric encryption can...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2020-36242
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1926227 1926228 1926528 1926529 1926530 1926531 1926532 1926571 1926767 1929131 1933071 1935581 1969514
Blocks: 1926229
TreeView+ depends on / blocked
 
Reported: 2021-02-08 13:21 UTC by Guilherme de Almeida Suckevicz
Modified: 2022-04-17 21:08 UTC (History)
53 users (show)

Fixed In Version: python-cryptography 3.3.2
Doc Type: If docs needed, set a value
Doc Text:
A buffer-overflow flaw was found in the python-cryptography package. In certain sequences of ``update()`` calls when symmetrically encrypting very large payloads (>2GB) could result in an integer overflow, leading to buffer overflows. Note: This fix is a workaround for the OpenSSL CVE-2021-23840 flaw. Source: pyca/cryptography project
Clone Of:
Environment:
Last Closed: 2021-05-18 20:38:20 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:3254 0 None None None 2021-08-24 08:09:07 UTC

Description Guilherme de Almeida Suckevicz 2021-02-08 13:21:22 UTC
In the cryptography package before 3.3.2 for Python, certain sequences of update calls to symmetrically encrypt multi-GB values could result in an integer overflow and buffer overflow, as demonstrated by the Fernet class.

References:
https://github.com/pyca/cryptography/issues/5615

Comment 1 Guilherme de Almeida Suckevicz 2021-02-08 13:21:53 UTC
Created python-cryptography tracking bugs for this issue:

Affects: fedora-all [bug 1926227]
Affects: openstack-rdo [bug 1926228]

Comment 2 Christian Heimes 2021-02-08 14:02:38 UTC
The fix is trivial: https://github.com/pyca/cryptography/pull/5748

diff --git a/src/cryptography/hazmat/backends/openssl/ciphers.py b/src/cryptography/hazmat/backends/openssl/ciphers.py
index 2b10681b31..0f96795fdc 100644
--- a/src/cryptography/hazmat/backends/openssl/ciphers.py
+++ b/src/cryptography/hazmat/backends/openssl/ciphers.py
@@ -16,7 +16,7 @@
 class _CipherContext(object):
     _ENCRYPT = 1
     _DECRYPT = 0
-    _MAX_CHUNK_SIZE = 2 ** 31 - 1
+    _MAX_CHUNK_SIZE = 2 ** 30 - 1
 
     def __init__(self, backend, cipher, mode, operation):
         self._backend = backend

Comment 3 Christian Heimes 2021-02-08 14:58:50 UTC
FEDORA-2021-8e36e7ed1a has been submitted as an update to Fedora 33.
https://bodhi.fedoraproject.org/updates/FEDORA-2021-8e36e7ed1a

Comment 14 Yadnyawalk Tale 2021-02-12 15:40:13 UTC
CloudForms stopped shipping python-cryptography 5.11 (5.0) onward. Support for 5.10 (4.7) is EOL from February 7, 2021. Please refer CloudForms Lifecycle page for more information: https://access.redhat.com/support/policy/updates/cloudforms

Comment 19 Summer Long 2021-03-15 01:24:37 UTC
Statement:

Triggering this flaw on in versions of python-cryptography as shipped with Red Hat Enterprise Linux 8 BaseOS, Appstream, as well as Red Hat Software Collections, can result in denial of service due to memory consumption or MemoryError exception.

In Red Hat OpenStack Platform, because the flaw has a lower impact and the fix would require a substantial amount of development, no update will be provided at this time for the RHOSP python-cryptography package.

Comment 20 Summer Long 2021-03-17 00:38:16 UTC
External References:

https://cryptography.io/en/latest/changelog.html#v3-3-2

Comment 21 Summer Long 2021-03-17 00:38:21 UTC
Mitigation:

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

Comment 31 errata-xmlrpc 2021-05-18 13:40:02 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:1608 https://access.redhat.com/errata/RHSA-2021:1608

Comment 32 Product Security DevOps Team 2021-05-18 20:38:20 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2020-36242

Comment 33 errata-xmlrpc 2021-06-03 10:24:29 UTC
This issue has been addressed in the following products:

  Red Hat Virtualization 4 for Red Hat Enterprise Linux 8

Via RHSA-2021:2239 https://access.redhat.com/errata/RHSA-2021:2239

Comment 36 errata-xmlrpc 2021-08-24 08:09:03 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

Via RHSA-2021:3254 https://access.redhat.com/errata/RHSA-2021:3254


Note You need to log in before you can comment on or make changes to this bug.