← Back to CVE Explorer

CVE-2026-13212

Full vulnerability record from the local CVENow database.

Description

The Zephyr virtio driver does not validate the descriptor-chain head id that the virtio device writes into the used ring. In virtio_isr() (drivers/virtio/virtio_common.c), the device-written vq->used->ring[idx].id is used directly as an index into vq->recv_cbs[] and vq->desc[], which are both allocated with exactly vq->num entries. recv_cbs[] holds {cb, opaque} callback entries, and the indexed callback pointer is then invoked as cbe.cb(cbe.opaque, used_len). Because the id is consumed as a 16-bit value with no bound check, a malicious or compromised virtio backend (an untrusted hypervisor, or an untrusted hardware/peer-processor virtio device on a PCI or MMIO transport) can supply an id far beyond vq->num. This causes an out-of-bounds read of a {function pointer, argument} pair from heap memory beyond recv_cbs[], after which the driver calls that attacker-shaped pointer in the guest's interrupt context. No guest privileges or user interaction are required; the backend triggers it by writing the shared used ring and raising the queue interrupt. The result is an arbitrary / attacker-influenced function-pointer call in the Zephyr guest, i.e. a control-flow-hijack primitive that can lead to code execution or, at minimum, a reliable crash. The fix rejects any used-ring id >= vq->num before indexing recv_cbs[]/desc[] or invoking the callback. This affects builds using CONFIG_VIRTIO with the PCI or MMIO transport.

Severity
HIGH
CVSS score
8.8 (v3.1)
Vulnerability status
Awaiting Analysis
Source identifier
Published
2026-08-24 16:16:55.393000
Last modified
2026-11-04 05:18:41.180000
View original CVE JSON
{
  "id": "CVE-2026-13212",
  "sourceIdentifier": "[email protected]",
  "published": "2026-08-24T16:16:55.393",
  "lastModified": "2026-11-04T05:18:41.180",
  "vulnStatus": "Awaiting Analysis",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "The Zephyr virtio driver does not validate the descriptor-chain head id that the virtio device writes into the used ring. In virtio_isr() (drivers/virtio/virtio_common.c), the device-written vq->used->ring[idx].id is used directly as an index into vq->recv_cbs[] and vq->desc[], which are both allocated with exactly vq->num entries. recv_cbs[] holds {cb, opaque} callback entries, and the indexed callback pointer is then invoked as cbe.cb(cbe.opaque, used_len).\n\nBecause the id is consumed as a 16-bit value with no bound check, a malicious or compromised virtio backend (an untrusted hypervisor, or an untrusted hardware/peer-processor virtio device on a PCI or MMIO transport) can supply an id far beyond vq->num. This causes an out-of-bounds read of a {function pointer, argument} pair from heap memory beyond recv_cbs[], after which the driver calls that attacker-shaped pointer in the guest's interrupt context. No guest privileges or user interaction are required; the backend triggers it by writing the shared used ring and raising the queue interrupt.\n\nThe result is an arbitrary / attacker-influenced function-pointer call in the Zephyr guest, i.e. a control-flow-hijack primitive that can lead to code execution or, at minimum, a reliable crash. The fix rejects any used-ring id >= vq->num before indexing recv_cbs[]/desc[] or invoking the callback. This affects builds using CONFIG_VIRTIO with the PCI or MMIO transport."
    },
    {
      "lang": "es",
      "value": "El controlador virtio de Zephyr no valida el ID de cabecera de la cadena de descriptores que el dispositivo virtio escribe en el anillo de usados. En virtio_isr() (drivers/virtio/virtio_common.c), el ID vq -> used -> ring[idx].id escrito por el dispositivo se utiliza directamente como un índice en vq -> recv_cbs[] y vq -> desc[], los cuales están ambos asignados con exactamente vq -> num entradas. recv_cbs[] contiene entradas de callback {cb, opaque}, y el puntero de callback indexado se invoca entonces como cbe.cb(cbe.opaque, used_len).\n\nDebido a que el ID se consume como un valor de 16 bits sin verificación de límites, un backend virtio malicioso o comprometido (un hipervisor no confiable, o un dispositivo virtio de hardware/procesador par no confiable en un transporte PCI o MMIO) puede suministrar un ID mucho más allá de vq -> num. Esto causa una lectura fuera de límites de un par {puntero de función, argumento} de la memoria del heap más allá de recv_cbs[], después de lo cual el controlador llama a ese puntero con forma de atacante en el contexto de interrupción del invitado. No se requieren privilegios de invitado ni interacción del usuario; el backend lo activa escribiendo en el anillo de usados compartido y elevando la interrupción de la cola.\n\nEl resultado es una llamada a puntero de función arbitraria / influenciada por el atacante en el invitado Zephyr, es decir, una primitiva de secuestro de flujo de control que puede conducir a la ejecución de código o, como mínimo, a un fallo fiable. La solución rechaza cualquier ID de anillo de usados >= vq -> num antes de indexar recv_cbs[]/desc[] o invocar el callback. Esto afecta a las compilaciones que utilizan CONFIG_VIRTIO con el transporte PCI o MMIO."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "zephyrproject",
          "product": "zephyr",
          "defaultStatus": "unaffected",
          "collectionURL": "https://github.com/zephyrproject-rtos/zephyr",
          "packageName": "zephyr",
          "programFiles": [
            "drivers/virtio/virtio_common.c"
          ],
          "versions": [
            {
              "version": "4.2.0",
              "lessThan": "4.3.2",
              "versionType": "semver",
              "status": "affected"
            },
            {
              "version": "4.4.0",
              "lessThan": "4.4.2",
              "versionType": "semver",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
          "baseScore": 8.8,
          "baseSeverity": "HIGH",
          "attackVector": "ADJACENT_NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "NONE",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 2.8,
        "impactScore": 5.9
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-08-24T20:19:17.728177Z",
          "id": "CVE-2026-13212",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "total"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-129"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/zephyrproject-rtos/zephyr/commit/fe47dbca080957c425383cc1d5bdc7d48a41d4a5",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-7884-373w-qqhx",
      "source": "[email protected]"
    }
  ]
}