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

Published Oct 26, 2026
·
Updated

The Espressif AES driver drivers/crypto/cryptoesp32aes.c advertises a multi-session cipher API — it hands out up to CONFIGESP32CRYPTOAESSESSIONSMAX (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 aesbeginsession() programmed them exactly once, at session start, outside the aeslock mutex that serialises the transforms. The per-operation handlers aesecbop(), aescbcop() and aesctrop() then ran aeshaltransformblock() 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 cipherbeginsession() 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 aesbeginsession() and reprograms the key and direction at the top of every operation, inside aeslock, so the chip-global registers can no longer be observed stale by another session.

Affected Software

1 affected component
Espressif ESP32 hardware crypto driver

Event History

Oct 26, 2026
CVE Published
via MITRE·04:08 PM
Data Sourced
via MITRE·04:08 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Is the default configuration affected?

Yes. The driver supports up to CONFIG_ESP32_CRYPTO_AES_SESSIONS_MAX independent sessions, and its default value is 4, so multiple sessions can exist under the default configuration.

2

What must an attacker be able to do to trigger the issue?

They must be able to induce creation of another AES session on the device with a different key or direction. A second session created between a first session's begin call and its transform can cause the first operation to use the second session's hardware state.

3

Will the driver report that an operation used the wrong key or direction?

No. The affected ECB, CBC, and CTR operation handlers use whichever key and direction are currently in the chip-global registers, and no error is reported.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203