CVE-2021-3782
JSON

6.6medium

An internal reference count is held on the buffer pool, incremented every time a new buffer is created from the pool.

Severity
6.6medium CVSS:3.1 by CISA-ADP
Exploit likelihood
0.32% (higher than 26% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
redhat

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

Product or packageVersionsReported by
waylandwayland 1.20.91CVE List
wayland waylandbefore 1.20.91NVD

All scores

CISA-ADP6.6medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H
NVD6.6medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H

Classification

CWE-190

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

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.

References

https://gitlab.freedesktop.org/wayland/wayland/-/issues/224exploit, issue-tracking, patch, third-party-advisory

Sources

SourceRecordLicence
CVE ListCVE-2021-3782 changed 2025-05-22CVE Terms of Use
NVDCVE-2021-3782 changed 2026-06-17Public domain