Vulnerability Details : CVE-2021-3782
Potential exploit
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.
Vulnerability category: OverflowMemory Corruption
Products affected by CVE-2021-3782
- cpe:2.3:a:wayland:wayland:*:*:*:*:*:*:*:*
Exploit prediction scoring system (EPSS) score for CVE-2021-3782
0.02%
Probability of exploitation activity in the next 30 days
EPSS Score History
~ 2 %
Percentile, the proportion of vulnerabilities that are scored at or less
CVSS scores for CVE-2021-3782
Base Score | Base Severity | CVSS Vector | Exploitability Score | Impact Score | Score Source | First Seen |
---|---|---|---|---|---|---|
6.6
|
MEDIUM | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H |
1.8
|
4.7
|
NIST |
CWE ids for CVE-2021-3782
-
The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.Assigned by:
- nvd@nist.gov (Primary)
- secalert@redhat.com (Secondary)
-
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.Assigned by: secalert@redhat.com (Secondary)
-
The product uses a reference count to manage a resource, but it does not update or incorrectly updates the reference count.Assigned by: secalert@redhat.com (Secondary)
References for CVE-2021-3782
-
https://gitlab.freedesktop.org/wayland/wayland/-/issues/224
Reference count overflow in shm leads to use-after-free (#224) · Issues · wayland / wayland · GitLabExploit;Issue Tracking;Patch;Third Party Advisory
Jump to