The patched EVP_EncodeBlock() now returns -1 for null buffers, negative lengths, or oversized inputs.
*A high‑severity (CVSS 9.8) flaw in OpenSSL's EVP_EncodeBlock() was patched on Nov 10, 2026. The fix returns -1 for invalid inputs, mirroring wolfSSL's behavior and adding guards to EVP_DecodeBlock().* *The change also corrects a length check in http_client.c and adds tests and documentation.*
On November 10, 2026, OpenSSL disclosed a critical buffer overflow in its EVP_EncodeBlock() routine, catalogued as CVE‑2026‑121481 with a CVSS score of 9.8. The flaw allowed attackers to overflow internal buffers by feeding malformed base64 data, a scenario reproducible via a massive -proxy_pass argument to the openssl s_client command. The OpenSSL Security Response Team (SRT) demanded a public fix, prompting a rapid pull request that altered the function's error handling. The patch returns -1 for any invalid input, a move that mirrors wolfSSL's defensive strategy and extends similar checks to EVP_DecodeBlock(). This article breaks down the vulnerability, the remediation, and the immediate impact on OpenSSL users.
CVE-2026-121481 allowed a buffer overflow in the EVP_EncodeBlock() function when supplied with malformed inputs. The overflow could be triggered from the command line by passing an oversized -proxy_pass argument to openssl s_client. GOST accepted the large password, but only when supplied via an environment variable, avoiding command‑line length limits. The flaw mirrors the pattern of CVE‑2021‑23840, indicating a recurring validation gap in OpenSSL's base64 handling.
The patch changes EVP_EncodeBlock() to return -1 for NULL buffers, negative lengths, or when the encoded size exceeds an int. It also adds a similar guard to EVP_DecodeBlock() and corrects the base64encode() length check, which previously rejected only lengths greater than INT_MAX. Reviewers flagged call sites like PEM_SignFinal() and NETSCAPE_SPKI_b64_encode() that might need to handle the new error code, but no further changes were merged in this PR. The fix is straightforward and aligns with wolfSSL's compatibility layer.
The changes landed in pull request #33652 on GitHub. Contributor nmouha authored the fix, added tests in test/base64_dec_avx2_test.c, and updated documentation in doc/man3/EVP_EncodeInit.pod. The OpenSSL Security Response Team (SRT) requested a public fix; the advisory remains pending. Review activity shows nhorman moving the PR through triage and review stages, while t8m and other reviewers requested verification that callers check the new -1 return values.
Deployments that rely on EVP_EncodeBlock() must now handle a possible -1 return. Libraries that ignore the return value risk undefined behavior if they cast it to size_t. The patch also eliminates the overflow risk in http_client.c's base64encode() function. Users of OpenSSL 4.0 and 4.1 branches receive the fix automatically when they update to the latest releases. Until the advisory is published, the vulnerability remains high‑risk for unpatched systems.
It affects the EVP_EncodeBlock() function in OpenSSL, allowing a buffer overflow when given invalid inputs such as null buffers or oversized lengths.
The patch makes EVP_EncodeBlock() and EVP_DecodeBlock() return -1 for invalid inputs and corrects the length check in the base64encode() function of http_client.c.
Yes, callers that do not check the return value, like PEM_SignFinal() and NETSCAPE_SPKI_b64_encode(), may need updates to handle the error correctly.
The OpenSSL community has closed a high‑severity gap, but the work is not finished. Developers must audit their code for unchecked return values, and administrators should roll out the updated libraries without delay. As the advisory awaits publication, the window for exploitation narrows, yet any lingering unpatched instance remains a prime target for attackers seeking to abuse base64 encoding routines.
Sources: Hacker News article referencing OpenSSL pull request #33652, GitHub comments, and OpenSSL SRT notes.