SecurityContext

CVE-2021-3782: wl_shm Buffer Pool - Use After Free

  • Cve: CVE-2021-3782
  • Name: wl_shm Buffer Pool - Use After Free
  • 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.
  • Impact: Attackers can cause use-after-free and leak server memory, potentially leading to arbitrary code execution or information disclosure.
  • Remediation: Implement proper handling to prevent integer overflow in reference counting, and consider using a larger data type or overflow checks.
  • Vulnerability type: use_after_free
  • Vulnerability impact: information_disclosure
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: medium
  • Cvss score: 6.6
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H
  • Epss score: 0.00321
  • Epss percentile: 0.25301
  • Assignee: [email protected]
  • Published at: 2022-09-23T16:15:10Z
  • Age in days: 1523
  • Modified at: 2026-06-17T04:05:45Z
  • Patch available: yes
  • Public exploits total: 1
  • References total: 1
  • Products total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-3782
  • Nvd status: modified
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits capped, oss, projects total, projects, rejected by nvd
  • Not known: requirements, hackerone

Cwe

IdName
CWE-190Integer Overflow or Wraparound

Public exploits

UrlSourceAdded date
https://gitlab.freedesktop.org/wayland/wayland/-/issues/224nvd2022-09-23

References

UrlSourceTags
https://gitlab.freedesktop.org/wayland/wayland/-/issues/224nvdExploit, Issue Tracking, Patch, Third Party Advisory

Products

ProductAffectedPlatform boundSourcesUrl
wayland:wayland< 1.20.91nonvd/v1/products/wayland/wayland

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Exploitation

  • Public exploit: yes
  • Public exploit count: 1
  • Public exploit first date: 2022-09-23
  • Authentication required: yes
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, remote
  • Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, hackerone reports, exposed hosts