NEWS

OpenSSL Still Debating How to Fix Critical EVP_EncodeBlock() Flaw Before Publishing Official Advisory

The OpenSSL security team itself asked for the fix to CVE-2026-121481 to be discussed in public, but the patch remains stuck in a debate over which error value to return without breaking applications that already use the affected function.

OpenSSL Still Debating How to Fix Critical EVP_EncodeBlock() Flaw Before Publishing Official Advisory
Image: Redação iMasters
News
Reading
5 min

A própria equipe de segurança... (not used)

The OpenSSL security team itself asked for the fix to CVE-2026-121481 to be discussed in public, but the patch remains stuck in a debate over which error value to return without breaking applications that already use the affected function.

A Very Low-Level Function, Used Everywhere

EVP_EncodeBlock() and EVP_DecodeBlock() are the base64 functions of libcrypto, the core of OpenSSL. They sit underneath routines for reading PEM certificates, S/MIME signing, and commands like openssl base64 and openssl s_client. Because OpenSSL is embedded in curl, Nginx, Python bindings, Node.js, and PHP, a bug here has a wide attack surface, even though it's a piece of code most developers never call directly.

The PR That Tries to Close the Gap

On November 10, 2026, contributor nmouha opened pull request #33652 in the openssl/openssl repository to fix CVE-2026-121481: a buffer overflow in EVP_EncodeBlock() that occurs when the input size is large enough that the size of the base64-encoded output no longer fits in an int. The proposed fix rejects invalid inputs: NULL buffers, negative sizes, or sizes that would overflow the limit. The same guard is suggested for EVP_DecodeBlock(), and the PR also fixes an incomplete size check in the base64encode() function in http_client.c, which previously only rejected len > INT_MAX without accounting for the base64-specific overflow.

The OpenSSL SRT has asked for it to be fixed publicly; the advisory is still pending.

nmouha, author of the patch in the OpenSSL project

The Demonstrated Exploitation Vector

The author himself described how to reproduce the problem from the command line:

Exploiting this vulnerability from the command line is possible by passing a large -proxy_pass to openssl s_client. I confirmed that GOST accepts these large passwords out of the box.

nmouha, author of the patch in the OpenSSL project

Because the command line has a size limit, the giant password needs to come from an environment variable (env:VAR). The PR itself notes that the bug pattern resembles CVE-2021-23840, an integer overflow flaw already publicly catalogued by the project in OpenSSL buffer functions years earlier: this type of error is not new to the codebase.

Internal Disagreement Blocks the Merge

Reviewer Tomáš Mráz (t8m) warned that returning -1 without changing the API contract could break third-party callers that cast the return value to size_t without checking the sign. Later in the same debate, user cmoyes-jump reinforced the point by citing CVE-2016-2105 as a precedent, another compatibility break in the same area of code. The discussion then shifted to whether the correct value would be 0 (which collides with a legitimate success case, when dlen == 0) or a call to OPENSSL_assert(), suggested by committer Bob Beck.

The assert proposal was strongly rejected by committer Matt Caswell:

Sorry, I am strongly against this. We should not be using OPENSSL_assert in the library. This is a DoS waiting to happen. We should simply return 0 and document it.

Matt Caswell, committer of the OpenSSL project

Bob Beck also questioned whether the case even deserves CVE status:

this PR also adds cases not in the report, and the report's reproducer is completely synthetic, and probably should not be a CVE without evidence it really happens.

Bob Beck, committer of the OpenSSL project

With this impasse, the PR remains today (November 20, 2026) with the hold: discussion label: the community has not yet settled on what the final behavior of the fixed function will be.

Affected Branches and Loose Ends

The PR's labels indicate that the fix, once it lands, will reach three branches: master, openssl-4.0, and openssl-4.1, meaning both current development and two already-released OpenSSL versions. Another point raised by reviewer Norbert Horman (nhorman) has not yet been resolved: two internal functions, PEM_SignFinal() and NETSCAPE_SPKI_b64_encode(), call EVP_EncodeBlock() without checking the return value, and would need a separate commit to avoid breaking silently once the new error behavior takes effect.

A reviewer also found undefined behavior in the AVX2-optimized path, which computes src + 0 even when src is NULL, a finding that, as of this report's publication, still has no public confirmation of being fixed in the PR.

What This Changes for Developers and Operators in Brazil

  • There is still no patch to apply. DevSecOps teams should not look for an already-fixed version of OpenSSL: it doesn't exist as of this report's publication, because the very shape of the fix is still open.
  • Those using openssl s_client with -proxy_pass pointing to GOST-authenticated proxies should avoid very large passwords in that parameter until the patch is finalized, and review automation scripts that build this command dynamically from environment variables.
  • Those who embed libcrypto in their own bindings (native Node.js addons, Python extensions, cgo in Go) and call EVP_EncodeBlock() or EVP_DecodeBlock() directly with sizes coming from untrusted input should add a size check at their own call layer, without waiting for upstream.
  • Any code that today ignores the return value of these two functions runs the risk of unexpected behavior once the fix is merged, whether it ends up being -1, 0, or an assert: it's worth auditing those call sites now, before the release.

What Remains Open

The official OpenSSL advisory for CVE-2026-121481 has not yet been published, the PR itself notes that "the advisory is still pending." This means the severity rating associated with this CVE still has no backing in a formal project announcement, and it could change depending on which fix is adopted and how exploitable the community considers the scenario to be outside the synthetic reproducer cited in the discussion. Until then, what exists concretely is an open pull request, with no merge date, carrying the label that signals the OpenSSL community needs, above all, to reach consensus on how a function that processes base64 should signal an error.

Translated from the Brazilian Portuguese original · Read the original