# CVE-2026-82390: Cross-session AES key confusion in the Espressif ESP32 hardware crypto driver


- **Severity:** Low 3.7 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Fix available:** No
- **Published:** 26 Oct 2026
- **Updated:** 26 Oct 2026
- **Also known as:** GHSA-rvww-w3mx-r99q, UBUNTU-CVE-2026-82390

## What is CVE-2026-82390?

CVE-2026-82390 is a low-severity vulnerability in zephyrproject zephyr, published on 26 Oct 2026. 

### Official description

The Espressif AES driver drivers/crypto/crypto_esp32_aes.c advertises a multi-session cipher API — it hands out up to CONFIG_ESP32_CRYPTO_AES_SESSIONS_MAX (default 4) independent sessions, each carrying its own key and direction. The AES peripheral, however, has a single chip-global set of key and mode registers, and aes_begin_session() programmed them exactly once, at session start, outside the aes_lock mutex that serialises the transforms. The per-operation handlers aes_ecb_op(), aes_cbc_op() and aes_ctr_op() then ran aes_hal_transform_block() against whatever key and direction the registers happened to hold.

As a result, once a second session is opened with a different key, every subsequent operation on the first session silently uses the second session's key and direction, and no error is reported. Because the key programming happened outside the lock, the correct usage pattern of "each thread does begin, then op, then free on its own session" also races: a second thread's cipher_begin_session() landing between the first thread's begin and its operation makes that operation run under the second thread's key. An attacker who can induce session creation on the device — for example a protocol peer whose connection causes a session key to be installed — can influence which key is resident when a victim operation runs.

The impact is a cryptographic failure rather than memory corruption: data the application believed it was protecting under one key is encrypted or decrypted under another. Where the resident key is one the attacker knows or supplied, the affected plaintext becomes recoverable by that attacker, and the operation's direction (encrypt versus decrypt) can likewise be inverted. Exposure requires an application that holds two or more concurrent sessions with different keys against this driver; no in-tree Zephyr subsystem does so today (the 802.15.4 security layer, which does open two sessions, uses CCM mode, which this driver rejects), so the risk falls on application code that uses the documented multi-session API.

The fix removes all hardware access from aes_begin_session() and reprograms the key and direction at the top of every operation, inside aes_lock, so the chip-global registers can no longer be observed stale by another session.

Weakness: CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization)

## Which versions are affected by CVE-2026-82390?


## How do I fix CVE-2026-82390?

No fix has been published for CVE-2026-82390 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-82390 being exploited?

There is no known exploitation of CVE-2026-82390 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-82390 and fix it if it is affected.

What it is: CVE-2026-82390 is a low-severity vulnerability in zephyrproject zephyr, published on 26 Oct 2026. 
Exploitation: There is no known exploitation of CVE-2026-82390 in the wild and no public exploit code.

Affected product: zephyrproject zephyr. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-82390/ (Markdown: https://insights.sbomify.com/CVE-2026-82390/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-82390
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-82390
- OSV: https://osv.dev/vulnerability/CVE-2026-82390

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-82390/
Summaries are generated and may contain mistakes; the official description above is the record.
