Bug 2222424 (CVE-2023-3180)

Summary: CVE-2023-3180 QEMU: virtio-crypto: heap buffer overflow in virtio_crypto_sym_op_helper()
Product: [Other] Security Response Reporter: Mauro Matteo Cascella <mcascell>
Component: vulnerabilityAssignee: Nobody <nobody>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: ddepaula, jen, jferlan, jmaloy, knoel, mkenneth, mrezanin, mst, pbonzini, security-response-team, virt-maint, ymankad
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the QEMU virtual crypto device while handling data encryption/decryption requests in virtio_crypto_handle_sym_req. There is no check for the value of `src_len` and `dst_len` in virtio_crypto_sym_op_helper, potentially leading to a heap buffer overflow when the two values differ.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-03 13:05:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2222427, 2228748    
Bug Blocks: 2213628    

Description Mauro Matteo Cascella 2023-07-12 17:20:02 UTC
A heap buffer overflow was found in virtio_crypto_sym_op_helper() in hw/virtio/virtio-crypto.c. It could occur while handling data encryption/dencryption requests in virtio_crypto_handle_sym_req(). There is no check for the value of the src_len and the dst_len in virtio_crypto_sym_op_helper(), so if src_len is not equal to dst_len, a heap based buff overflow occurs while encrypting/dencrypting the data.

Comment 3 Mauro Matteo Cascella 2023-08-03 07:17:52 UTC
Upstream patch:
https://lists.nongnu.org/archive/html/qemu-devel/2023-08/msg00401.html

Comment 4 Mauro Matteo Cascella 2023-08-03 07:18:12 UTC
Created qemu tracking bugs for this issue:

Affects: fedora-all [bug 2228748]

Comment 5 Product Security DevOps Team 2023-08-03 13:05:54 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-2023-3180

Comment 6 Mauro Matteo Cascella 2023-08-04 07:25:01 UTC
Upstream commit:
https://gitlab.com/qemu-project/qemu/-/commit/9d38a8434721a6479fe03fb5afb150ca793d3980