Skip to content

michal/crypto/fix-aead-cipher-key-buffer-overread/OTP-20244#11337

Open
Mikaka27 wants to merge 1 commit into
erlang:maintfrom
Mikaka27:michal/crypto/fix-aead-cipher-key-buffer-overread/OTP-20244
Open

michal/crypto/fix-aead-cipher-key-buffer-overread/OTP-20244#11337
Mikaka27 wants to merge 1 commit into
erlang:maintfrom
Mikaka27:michal/crypto/fix-aead-cipher-key-buffer-overread/OTP-20244

Conversation

@Mikaka27

@Mikaka27 Mikaka27 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Prevents chacha20-1305 aead cipher encryption/decryption from accepting too long/short key size. For chacha20-1305 openssl reads fixed 32 bytes from the buffer passed by the user, even if the buffer is shorter in reality, triggering out of bounds read, and we had checks for that disabled.

In addition to that EVP_CIPHER_CTX_set_key_length calls were added for all aead ciphers, this might detect invalid key sizes set by the programmer in the source code, because this function will validate the key size even for fixed key size ciphers.
Contains the fix from #11330 because added validation also causes an early exit, and destructor trying to free a garbage pointer.

@Mikaka27 Mikaka27 self-assigned this Jul 3, 2026
@Mikaka27 Mikaka27 added the team:PS Assigned to OTP team PS label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

  2 files   14 suites   5m 44s ⏱️
193 tests 175 ✅  18 💤 0 ❌
495 runs  344 ✅ 151 💤 0 ❌

Results for commit 9852099.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@Mikaka27 Mikaka27 added the testing currently being tested, tag is used by OTP internal CI label Jul 3, 2026
@Mikaka27 Mikaka27 requested review from Whaileee and garazdawi and removed request for Whaileee July 9, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant