Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-3782

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-3782
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:52 UTC · Revision 1

Source evidence

CVE-2021-3782

core-osv · Original source

Published 23 Sept 2022, 16:15 UTC

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.

osv:CVE-2021-3782
Complete source record
{
  "id": "708823b089991a5073dbc5b597b6000bdc8b619338c938834541e658c7bcbf27",
  "url": "https://osv.dev/vulnerability/CVE-2021-3782",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-3782",
    "summary": "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.",
    "evidence": "osv:CVE-2021-3782",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-3782",
      "aliases": [
        "CVE-2021-3782"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://gitlab.freedesktop.org/wayland/wayland",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "73d4d2410e2e0d0579bacc7f87d37bf4ec15cbbb"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:wayland:wayland:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.20.91"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.20.0",
            "1.19.93",
            "1.19.92",
            "1.19.91",
            "1.19.0",
            "1.18.93",
            "1.18.92",
            "1.18.91",
            "1.18.0",
            "1.17.93",
            "1.17.92",
            "1.17.91",
            "1.17.0",
            "1.16.93",
            "1.16.92",
            "1.16.91",
            "1.16.0",
            "1.15.94",
            "1.15.93",
            "1.15.92",
            "1.15.91",
            "1.15.0",
            "1.14.93",
            "1.14.92",
            "1.14.91",
            "1.14.0",
            "1.13.93",
            "1.13.92",
            "1.13.91",
            "1.13.0",
            "1.12.93",
            "1.12.92",
            "1.12.91",
            "1.12.0",
            "1.11.94",
            "1.11.0",
            "1.11.93",
            "1.11.92",
            "1.11.91",
            "1.10.93",
            "1.10.92",
            "1.10.91",
            "1.10.0",
            "1.9.93",
            "1.9.92",
            "1.9.91",
            "1.9.0",
            "1.8.93",
            "1.8.92",
            "1.8.91",
            "1.8.0",
            "1.7.93",
            "1.7.92",
            "1.7.91",
            "1.7.0",
            "1.6.93",
            "1.6.92",
            "1.6.91",
            "1.6.0",
            "1.5.93",
            "1.5.92",
            "1.5.91",
            "1.5.0",
            "1.4.93",
            "1.4.92",
            "1.4.91",
            "1.4.0",
            "1.3.93",
            "1.3.92",
            "1.3.91",
            "1.3.0",
            "1.2.92",
            "1.2.91",
            "1.2.0",
            "1.1.91",
            "1.1.0",
            "1.0.90",
            "1.0.1",
            "1.0.0",
            "0.99.0",
            "0.95.0",
            "0.94.90"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-3782.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:52.248053222Z",
      "provider": "osv",
      "references": [
        "https://gitlab.freedesktop.org/wayland/wayland/-/issues/224"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-3782",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 386311,
  "published_at": "2022-09-23T16:15:10.143+00:00"
}