Vulnerability · Published Sep 23, 2022 · Assigned by redhat
CVE-2021-3782
Medium 6.6
In plain English
A medium-severity integer overflow in wayland. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 25% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | libwayland-client | 1.21.0-1.el8 | ALSA-2023:2786 |
| AlmaLinux:8 | libwayland-cursor | 1.21.0-1.el8 | ALSA-2023:2786 |
| AlmaLinux:8 | libwayland-egl | 1.21.0-1.el8 | ALSA-2023:2786 |
| AlmaLinux:8 | libwayland-server | 1.21.0-1.el8 | ALSA-2023:2786 |
| AlmaLinux:8 | wayland-devel | 1.21.0-1.el8 | ALSA-2023:2786 |
| Debian:12 | wayland | 1.21.0-1 | DEBIAN-CVE-2021-3782 |
| Debian:13 | wayland | 1.21.0-1 | DEBIAN-CVE-2021-3782 |
| Debian:14 | wayland | 1.21.0-1 | DEBIAN-CVE-2021-3782 |
| Rocky Linux:8 | wayland | 0:1.21.0-1.el8 | RLSA-2023:2786 |
| Ubuntu:22.04:LTS | wayland | 1.20.0-1ubuntu0.1 | USN-5614-1 |
| Ubuntu:22.04:LTS | wayland | 1.20.0-1ubuntu0.1 | UBUNTU-CVE-2021-3782 |
Affected products (as reported)
Weakness: CWE-190 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H
References
- https://gitlab.freedesktop.org/wayland/wayland/-/issues/224 x_refsource_MISC