OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-121481, CVSS 9.8)

Source: github.com
364 points by JacobHenner 22 hours ago on hackernews | 326 comments
This fixes the buffer overflow in `EVP_EncodeBlock()` (CVE-2026-121481)
by returning `-1` for invalid inputs. It also provides a similar guard
for `EVP_DecodeBlock()`, and fixes the incorrect length check in the
`base64encode()` function of `http_client.c`. Also updates the
documentation and adds new tests.

@nmouha

nhorman

nhorman previously approved these changes Nov 11, 2026

t8m

t8m requested changes Nov 12, 2026

bob-beck

@bob-beck bob-beck added the hold: discussion

The community needs to establish a consensus how to move forward with the issue or PR

label

Nov 13, 2026

bob-beck

@nmouha

@nmouha

This fixes the buffer overflow in `EVP_EncodeBlock()` (CVE-2026-121481)
by calling `OPENSSL_assert()` for inputs that lead to undefined
behavior. The same fix is applied to `EVP_DecodeBlock()`, and the
incorrect length check in `base64encode()` of `http_client.c`
is fixed. Also updates the documentation and adds new tests to document
the existing behavior for zero-length inputs.

@nmouha

@andrewkdinh

@nmouha

…ock()

This fixes the buffer overflow in `EVP_EncodeBlock()` (CVE-2026-121481)
by calling `OPENSSL_assert()` for inputs that lead to undefined
behavior. The same fix is applied to `EVP_DecodeBlock()`, and the
incorrect length check in `base64encode()` of `http_client.c`
is fixed. Also updates the documentation and adds new tests to document
the existing behavior for zero-length inputs.

@nmouha

andrewkdinh

@nmouha

@nmouha

…ncodeBlock()

This fixes the buffer overflow in `EVP_EncodeBlock()` (CVE-2026-121481)
by calling `OPENSSL_assert()` for inputs that lead to undefined
behavior. The same fix is applied to `EVP_DecodeBlock()`, and the
incorrect length check in `base64encode()` of `http_client.c`
is fixed. Also updates the documentation and adds new tests to document
the existing behavior for zero-length inputs.

@nmouha

andrewkdinh