RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2172416 - Backport from_buffer(..., require_writable=True) for python-cryptography CVE-2023-23931 fix [rhel-8.9]
Summary: Backport from_buffer(..., require_writable=True) for python-cryptography CVE-...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: python-cffi
Version: 8.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Christian Heimes
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks: 2172404
TreeView+ depends on / blocked
 
Reported: 2023-02-22 10:45 UTC by Christian Heimes
Modified: 2023-11-14 17:59 UTC (History)
6 users (show)

Fixed In Version: python-cffi-1.11.5-6.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-14 15:48:23 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-9492 0 None None None 2023-02-22 10:46:37 UTC
Red Hat Issue Tracker RHELPLAN-149627 0 None None None 2023-02-22 10:46:40 UTC
Red Hat Product Errata RHBA-2023:7095 0 None None None 2023-11-14 15:48:26 UTC

Description Christian Heimes 2023-02-22 10:45:13 UTC
Description of problem:
cffi 1.12 added a new keyword argument "require_writable=True" to its from_buffer() API. The feature is required to fix python-cryptography CVE-2023-23931.

Version-Release number of selected component (if applicable):
python3-cffi-1.11.5-5.el8

How reproducible:
always

Steps to Reproduce:
$ python3
>>> from cryptography.hazmat.backends.openssl import backend
>>> b = b'bytes'
>>> buf = backend._ffi.from_buffer(b)
>>> buf[0] = b'a'
>>> b
b'aytes'
>>> buf = backend._ffi.from_buffer(b, require_writable=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: from_buffer() takes no keyword arguments

Actual results:
TypeError: from_buffer() takes no keyword arguments

Expected results:
from_buffer(b, require_writable=True) is supported

Additional info:
changelog: https://cffi.readthedocs.io/en/latest/whatsnew.html?highlight=require_writable#v1-12
upstream issue: https://foss.heptapod.net/pypy/cffi/-/issues/394
upstream commit: https://foss.heptapod.net/pypy/cffi/-/commit/c5c4d32c3e3ec0fbaabc4b9890fd17c9c58407d2

Comment 17 Michal Polovka 2023-04-21 12:31:00 UTC
Preverified using test compose http://artifacts.osci.redhat.com/comp/rhel-8.9.0/52100464-4011-python-cryptography/ with python3-cryptography-3.2.1-6.el8.x86_64  and python3-cffi-1.11.5-6.el8.x86_64     

Python 3.6.8 (default, Jan 23 2023, 22:31:05) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cryptography.hazmat.backends.openssl import backend
>>> b = b'bytes'
>>> buf = backend._ffi.from_buffer(b)
>>> buf[0] = b'a'
>>> b
b'aytes'
>>> buf = backend._ffi.from_buffer(b, require_writable=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
BufferError: Object is not writable.
>>> 

parameter require_writable supported, marking as tested.

Comment 21 Michal Polovka 2023-04-24 08:27:13 UTC
Verified manually using nightly RHEL8.9 machine with python3-cffi-1.11.5-6.el8.x86_64 and python3-cryptography-3.2.1-6.el8.x86_64.


# python3
Python 3.6.8 (default, Jan 23 2023, 22:31:05) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cryptography.hazmat.backends.openssl import backend
>>> b = b'bytes'
>>> buf = backend._ffi.from_buffer(b)
>>> buf[0] = b'a'
>>> b
b'aytes'
>>> buf = backend._ffi.from_buffer(b, require_writable=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
BufferError: Object is not writable.

Marking as verified.

Comment 24 errata-xmlrpc 2023-11-14 15:48:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (python-cffi bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:7095


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