// For flags

CVE-2021-3782

wayland: libwayland-server wl_shm reference-count overflow

Severity Score

6.6
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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.

Se mantiene un recuento interno de referencias en el pool de buffers, que es incrementado cada vez que es creado un nuevo buffer desde el pool. El recuento de referencias es mantenido como un int; en sistemas LP64 esto puede causar que el recuento de referencias sea desbordado si el cliente crea un gran número de objetos de búfer wl_shm, o si puede coaccionar al servidor para que cree un gran número de referencias externas al almacenamiento de búferes. Con el recuento de referencias desbordado, puede construirse un uso de memoria previamente liberada en la estructura de seguimiento de wl_shm_pool, donde los valores pueden ser incrementados o disminuidos; también puede ser posible construir un oráculo limitado para filtrar 4 bytes de memoria del lado del servidor al cliente atacante a la vez.

Wayland is a protocol for a compositor to talk to its clients, as well as a C library implementation of that protocol. The compositor can be a standalone display server running on Linux kernel modesetting and evdev input devices, an X application, or a wayland client itself. The clients can be traditional applications, X servers or other display servers.

*Credits: N/A
CVSS Scores
Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
High
Attack Vector
Local
Attack Complexity
Low
Authentication
Single
Confidentiality
Partial
Integrity
Partial
Availability
Complete
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2021-09-09 CVE Reserved
  • 2022-09-16 CVE Published
  • 2024-04-15 EPSS Updated
  • 2024-08-03 CVE Updated
  • 2024-08-03 First Exploit
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-190: Integer Overflow or Wraparound
  • CWE-416: Use After Free
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Wayland
Search vendor "Wayland"
Wayland
Search vendor "Wayland" for product "Wayland"
< 1.20.91
Search vendor "Wayland" for product "Wayland" and version " < 1.20.91"
-
Affected