CVE-2021-3782 Integer overflow in wayland
Integer overflow in Wayland buffer pool reference counting allows use-after-free, potentially leading to code execution or memory leakage.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-3782?
CVE-2021-3782 is a medium-severity vulnerability in wayland, published on 23 Sep 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
An internal reference count is held on the buffer pool, incremented every time a new buffer is created from the pool. The reference count is maintained as an int; on LP64 systems this can cause the reference count to overflow if the client creates a large number of wl_shm buffer objects, or if it can coerce the server to create a large number of external references to the buffer storage. With the reference count overflowing, a use-after-free can be constructed on the wl_shm_pool tracking structure, where values may be incremented or decremented; it may also be possible to construct a limited oracle to leak 4 bytes of server-side memory to the attacking client at a time.
Weakness: CWE-190
Which versions are affected by CVE-2021-3782?
It affects 1 product.
Linux distribution packages (40)
libwayland-client AlmaLinux:8 | All versions | 1.21.0-1.el8 |
libwayland-cursor AlmaLinux:8 | All versions | 1.21.0-1.el8 |
libwayland-egl AlmaLinux:8 | All versions | 1.21.0-1.el8 |
libwayland-server AlmaLinux:8 | All versions | 1.21.0-1.el8 |
wayland-devel AlmaLinux:8 | All versions | 1.21.0-1.el8 |
libwayland-client Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
libwayland-client-debuginfo Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
libwayland-cursor Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
libwayland-cursor-debuginfo Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
libwayland-egl Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
libwayland-egl-debuginfo Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
libwayland-server Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
libwayland-server-debuginfo Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
wayland Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
wayland-debuginfo Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
wayland-debugsource Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
wayland-devel Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
wayland-devel-debuginfo Red Hat:enterprise_linux:8::appstream | All versions | 0:1.21.0-1.el8 |
wayland Rocky Linux:8 | All versions | 0:1.21.0-1.el8 |
wayland SUSE:Enterprise Storage 7 | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Enterprise Storage 7.1 | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 1.16.0-150100.7.3.1 |
wayland SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise Micro 5.2 | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise Micro 5.3 | All versions | 1.19.0-150400.3.3.1 |
wayland SUSE:Linux Enterprise Micro 5.4 | All versions | 1.19.0-150400.3.3.1 |
wayland SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 1.19.0-150400.3.3.1 |
wayland SUSE:Linux Enterprise Real Time 15 SP3 | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise Server 12 SP5 | All versions | 1.13.0-3.3.1 |
wayland SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 1.16.0-150100.7.3.1 |
wayland SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 1.13.0-3.3.1 |
wayland SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 1.16.0-150100.7.3.1 |
wayland SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 1.18.0-150200.3.3.1 |
wayland SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 1.13.0-3.3.1 |
wayland SUSE:Manager Proxy 4.2 | All versions | 1.18.0-150200.3.3.1 |
Products include Wayland Wayland.
How do I fix CVE-2021-3782?
Apply the vendor's patch.
Is CVE-2021-3782 being exploited?
There is no known exploitation of CVE-2021-3782 in the wild and no public exploit code.
Sources
Also known as ALSA-2023:2786, AZL-11019, DEBIAN-CVE-2021-3782, GHSA-pvw2-9h4r-c5cr, JLSEC-2026-97, MGASA-2022-0418 and 10 more.