Bug 2036966 (CVE-2021-4207)

Summary: CVE-2021-4207 QEMU: QXL: double fetch in qxl_cursor() can lead to heap buffer overflow
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: berrange, carnil, cfergeau, crobinso, dbecker, eglynn, jen, jferlan, jforbes, jjoyce, jmaloy, jschluet, knoel, lhh, lkundrak, lpeer, m.a.young, mburns, mcascell, mkenneth, mrezanin, mst, ondrejj, pbonzini, philmd, ribarry, rjones, sclewis, security-response-team, slinaber, spower, virt-maint, virt-maint
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm 7.0.0 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the QXL display device emulation in QEMU. A double fetch of guest controlled values `cursor->header.width` and `cursor->header.height` can lead to the allocation of a small cursor object followed by a subsequent heap-based buffer overflow. A malicious privileged guest user could use this flaw to crash the QEMU process on the host or potentially execute arbitrary code within the context of the QEMU process.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-31 02:55:52 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: 2070896, 2040736, 2040737, 2040738, 2040739, 2070895, 2075683    
Bug Blocks: 2040475, 2054405    

Description Pedro Sampaio 2022-01-04 14:21:07 UTC
In the QEMU QXL video acelerator a double fetch leads to heap overflow in qxl_unpack_chunks function.

Comment 5 Mauro Matteo Cascella 2022-04-01 10:09:28 UTC
Created qemu tracking bugs for this issue:

Affects: epel-7 [bug 2070896]
Affects: fedora-all [bug 2070895]

Comment 6 Mauro Matteo Cascella 2022-04-01 10:21:10 UTC
STAR Labs security advisory: https://starlabs.sg/advisories/21-4207.

Comment 7 Salvatore Bonaccorso 2022-04-07 04:28:16 UTC
Hi

Is CVE-2021-4207 as assignment correct? The bugzilla entry say CVE-2021-4207 while https://starlabs.sg/advisories/22-4207/ say it's CVE-2022-4207. I assume this was Red Hat assigned and so given the disclosure timeline as well mentioned in the blog article the 2021 one is the correct one?

Comment 8 Mauro Matteo Cascella 2022-04-07 08:02:05 UTC
You're right, CVE-2021-4207 is the correct CVE id. I asked them to update the security advisory accordingly. Thank you for the heads up.

Comment 9 Salvatore Bonaccorso 2022-04-07 19:25:50 UTC
(In reply to Mauro Matteo Cascella from comment #8)
> You're right, CVE-2021-4207 is the correct CVE id. I asked them to update
> the security advisory accordingly. Thank you for the heads up.

Hi Mauro. Thanks for confirming it as well here!

Regards,
Salvatore

Comment 11 Mauro Matteo Cascella 2022-04-08 15:38:23 UTC
In reply to comment #7:
> Is CVE-2021-4207 as assignment correct? The bugzilla entry say CVE-2021-4207
> while https://starlabs.sg/advisories/22-4207/ say it's CVE-2022-4207.

The fixed advisory is 21-4207 which is now listed on the main Advisories page: https://starlabs.sg/advisories. The same holds for 21-4206 (bz#2036998). The obsolete 22-4206 and 22-4207 are not listed anymore but unfortunately they are still accessible with direct link.

Comment 12 Mauro Matteo Cascella 2022-04-08 15:39:19 UTC
Upstream fix:
https://gitlab.com/qemu-project/qemu/-/commit/9569f5cb

Comment 13 errata-xmlrpc 2022-06-13 11:51:28 UTC
This issue has been addressed in the following products:

  Advanced Virtualization for RHEL 8.4.0.EUS

Via RHSA-2022:5002 https://access.redhat.com/errata/RHSA-2022:5002

Comment 14 errata-xmlrpc 2022-08-02 10:01:02 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:5821 https://access.redhat.com/errata/RHSA-2022:5821

Comment 15 Product Security DevOps Team 2022-08-31 02:55:49 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-2021-4207