Skip to content- Sources: primary, discussion
- Summary: Pull request 33652, opened on 2026-11-10 by Nicky Mouha, fixes CVE-2026-121481 in EVP_EncodeBlock for inputs whose encoded size does not fit in an int. The reporter says the OpenSSL security team asked for a public fix while the advisory is still pending. The PR is labeled for master and the 4.0 and 4.1 branches. The reporter shows openssl s_client can trigger it with a large -proxy_pass read from an environment variable. Maintainer Bob Beck called the reproducer synthetic, and after a debate over returning -1 or 0 the patch moved to OPENSSL_assert.
- Why it matters: Code on OpenSSL 4.0 or 4.1 that base64-encodes input of attacker-controlled size through EVP_EncodeBlock should cap the length until a fixed release ships.
- Background: EVP_EncodeBlock takes an input pointer, an output pointer and an input length but no output length, so each caller must size the output buffer itself from the rule that every 3 input bytes become 4 output bytes, plus a NUL. The function computes and returns that length as a signed int, so very large inputs can overflow the arithmetic and the function then writes past the buffer the caller allocated. The reporter compares the pattern to CVE-2021-23840, an earlier OpenSSL integer overflow.
- Follow-up: The OpenSSL security advisory and fixed 4.0 and 4.1 releases.
- Comments: The Hacker News thread drew 208 points and 156 comments. Commenters blame an API that never receives the output buffer size. One says the flaw sits in code written for OpenSSL 4.x, and others point to rustls and BoringSSL as alternatives.