OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-121481, CVSS 9.8) github...
HN Best 200 @best
OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-121481, CVSS 9.8) github.com · 54 points · 30 comments · HN thread
TL;DR A pull request to OpenSSL fixes a buffer overflow in EVP_EncodeBlock() tracked as CVE-2026-121481, rated CVSS 9.8 by the report. The PR replaces undefined-behavior cases with OPENSSL_assert() checks rather than returning new error codes, applies similar guards to EVP_DecodeBlock(), and fixes a length check in base64encode() in http_client.c. The thread is mostly about whether the CVSS score is inflated and how hard the base64 API is to use safely.
- The overflow occurs in EVP_EncodeBlock() when the input is very large, roughly above 1.5 GB on platforms where int is 32 bits, because the output length computation overflows a signed int.
- An earlier draft of the PR returned -1 on invalid inputs; after reviewer objections that existing callers might cast the return value without checking, the author switched to OPENSSL_assert() for inputs that previously caused undefined behavior, so callers see no new error returns.
- The same guard is added to EVP_DecodeBlock(), and an incorrect length check in base64encode() in http_client.c is corrected.
- The PR also updates documentation and adds tests that pin down the existing behavior for zero-length inputs.
- Commenters note that only OpenSSL 4.x is affected, since LibreSSL forked before OpenSSL 3 and the bug is in the new 4.x code path.
Discussion The thread is a mix of technical reading of the bug, criticism of the base64 C API design, and an argument about CVSS scoring. Early commenters summarize the bug as a failure on inputs above about 1.5 GB and debate whether the API is badly designed or just needs careful callers. A second strand questions the 9.8 rating, arguing exploitability depends entirely on whether untrusted input can reach the function, and that the score is more marketing than measurement. The mood is frustrated and sardonic, with several people venting about the burden of patching and a few jokes about Rust and Heartbleed.
- CVSS 9.8 is exaggerated for this bug (many): Commenters argue the function is internal and only fails on very large inputs, so risk depends entirely on whether attacker-controlled data can reach it. Services that encode user uploads in memory are exposed, while fixed-size protocol fields are not.
- The base64 API is poorly designed (many): Several argue that requiring callers to compute output buffer sizes with no output length parameter invites exactly this kind of bug. Others reply that the formula is simple 4/3 expansion and that the caller owns allocation.
- CVSS scores are not meaningful (some): One commenter says CVSS is easily manipulated by vendors and researchers and calls for a less malleable severity system.
- Only OpenSSL 4 is affected, so most systems are safe (some): Users note that LibreSSL predates the bug and that the issue only appears in OpenSSL 4.x, though Fedora 45 ships it and some people are patching now.
- Returning error codes versus asserting (a few): The PR debate over returning -1 versus returning 0 or asserting appears in the discussion, with reviewers worried that changing return values could break existing third-party callers.
- Patch fatigue and the role of AI in finding bugs (a few): Some commenters say LLM-assisted vulnerability discovery will drive more patches, and argue platforms need monitoring, live patching, or isolation rather than only keeping up with updates.
Links from the comments
- OpenSSL 1.0.2 documentation for the EVP base64 encoding functions, cited for the API's buffer size rules.
- Blog series on recurring memory-safety bugs, cited sarcastically in response to the claim that no prevention is possible.
- libyuv convert header, cited as another example of C APIs that invite buffer size misuse.