# CVE-2026-121481: OpenSSL EVP_EncodeBlock() overflow, affected branches and fix status

> A CVSS 9.8 overflow in OpenSSL's base64 encoder has a public fix PR labelled for master, 4.0 and 4.1. The advisory is pending, the sources name no fixed release, and maintainers still disagree on the fix.

- Published: 2026-11-20
- By: Samir Sengupta (https://www.samcodeman.com/about)
- Canonical: https://www.samcodeman.com/writing/cve-2026-121481-openssl-evp-encodeblock-overflow
- How this was made: Drafted with Claude, Anthropic's model from 1 cited source, then checked against it in a second editing pass. Editorial policy: https://www.samcodeman.com/editorial-policy

## The short version

- OpenSSL PR #33652 is labelled for the master, 4.0 and 4.1 branches. The PR describes the advisory as pending, and the sources name no fixed release.
- The overflow needs an input whose base64 length no longer fits in an int. The original guard puts that at (INT_MAX / 4) * 3 bytes, about 1.5 GiB with a 32-bit int.
- The only reproducer in the sources is local: a very large -proxy_pass given to openssl s_client through an environment variable.
- Maintainers had not agreed whether invalid input should return -1, return 0 or trigger OPENSSL_assert(), so the final API behavior is still open.

CVE-2026-121481 is a buffer overflow in OpenSSL's EVP_EncodeBlock(), the base64 encoder, and it carries a CVSS score of 9.8. The proposed fix, pull request #33652, is labelled for the master, 4.0 and 4.1 branches. The PR describes the advisory as still pending, and the sources name no fixed release. The only reproducer in the sources is local: a very large -proxy_pass passed to openssl s_client. The sources show no remote path through base64 or PEM encoding in a common service.

Contributor nmouha opened the pull request on November 10, 2026. It says the OpenSSL SRT asked for the bug to be fixed publicly while the advisory is still pending. Reviewers then argued over how EVP_EncodeBlock() should report invalid input, and several requested changes. The last comments in the source, dated November 20, still disagree. Engineers do not yet have a tag or version number to upgrade to.

## PR labels target OpenSSL master, 4.0 and 4.1

On November 11, jogme labelled the PR with three branches: master, openssl-4.0 and openssl-4.1. The same day, t8m added the labels triaged: bug and severity: important. The sources do not say whether the 3.x series is affected, so the branch labels are the only primary signal on scope.

Commenters on Hacker News offered their own claims, none of them verified. One asked whether only OpenSSL 4 is impacted. Another said no enterprise distro has shipped OpenSSL 4 yet. A third said OpenSSL 4.2 is the first proper 4.x LTS release, so most distros will still be on 3.x, while Arch and Fedora are already on 4.x. One commenter said they were writing from Fedora 45. Teams should confirm the OpenSSL version in their own images and not rely on the thread.

## Base64 length overflows past about 1.5 GiB

A Hacker News commenter quoted the OpenSSL documentation for EVP_EncodeBlock(). It produces 4 bytes of output for every 3 bytes of input, pads the final block to a multiple of 4, and adds a NUL terminator. The commenter pointed out that the caller sizes the output buffer and does not pass its length in, so the function cannot validate it. The PR rejects lengths for which the encoded size does not fit in an int. The original revision of that guard read:

```c
/* Ensure the base64 output length does not overflow. */
if (dlen > (INT_MAX / 4) * 3)
    return -1;
```

With a 32-bit int, that threshold works out to 1,610,612,733 input bytes. A Hacker News commenter described the bug as EVP_EncodeBlock malfunctioning when the input is larger than about 1.5GB. Another commenter noted that the figure applies on systems where ints are 32 bits. The original PR also rejected NULL buffers and negative lengths. It added similar checks to EVP_DecodeBlock(), which needs no length limit because the decoded length always fits in an int. Tests went into test/base64_dec_avx2_test.c, and the new returns were documented in doc/man3/EVP_EncodeInit.pod. The author notes that the pattern is similar to CVE-2021-23840.

The PR also changes the base64encode() function in http_client.c. The author calls that function's length check incorrect because it rejected only len > INT_MAX. The PR does not say whether that function is reachable with attacker-controlled input.

## Is CVE-2026-121481 reachable remotely?

The sources show no remote path. The PR says exploitation from the command line is possible by passing a large -proxy_pass to openssl s_client. The author confirmed that GOST accepts such large passwords out of the box. The password has to be supplied through an environment variable (env:VAR), because otherwise the command line is too long.

Reviewer jogme pointed out that the patch lets these functions fail. jogme asked that call sites check the return value and named PEM_SignFinal() and NETSCAPE_SPKI_b64_encode() as the problematic places. t8m replied that this need not be part of the PR unless these callers can plausibly trigger the error conditions, and that it should be a separate commit. bob-beck said the PR adds cases not in the report, and called the report's reproducer synthetic.

> the report's reproducer is completely synthetic, and probably should not be a CVE without evidence it really happens
>
> - bob-beck, review comment on OpenSSL PR #33652

On Hacker News, the top-ranked question was what the 9.8 actually means. The commenter asked whether it is an obscure feature with a lucky exploit or any OpenSSL socket exposed to the internet. A reply worked through the vector AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, using GitHub's values from GHSA-83xj-7xh4-4p7x, and arrived at 9.76. Another reply compared the bug to Java4shell but said that needed verification. One commenter said the bug does not appear to be easily exploitable, and that the callers of EVP_EncodeBlock should be inspected to determine the actual risk. The sources name no remote service that base64-encodes attacker data over 1.5 GiB.

## Maintainers split on -1, 0 or OPENSSL_assert

The error contract is still being argued. t8m worried that existing third-party callers might cast the return value to size_t without checking it, and asked for 0 instead of -1. nmouha replied with three points. Both functions legitimately return 0 on success, EVP_DecodeBlock() already returns -1 on its existing failure paths, and wolfSSL's OpenSSL compatibility layer returns -1. nhorman suggested returning 0 with ERR_raise_data. bob-beck said STYLE.md rules out failure cases that look like success. bob-beck proposed documenting that negative lengths are not accepted and using an assert. nhorman then suggested making a dlen overflow an asserted failure, and nmouha suggested OPENSSL_assert().

> 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.
>
> - mattcaswell, review comment on OpenSSL PR #33652, November 20, 2026

A commenter on the PR, cmoyes-jump, agreed that returning -1 without an API contract change is worse than returning 0. They cited CVE-2016-2105 in EVP_EncodeUpdate(), in the same file. They called a silent 0 the best backward-compatible mitigation, called an API contract change the best forward fix, and suggested ERR_raise_data and/or __owur. bob-beck also noted that STYLE.md wants an error on the stack for public functions. That means ERR_R_PASSED_NULL_PARAMETER for NULL pointers and ERR_R_PASSED_INVALID_ARGUMENT for negative or oversized lengths.

Review also caught a regression. Rejecting f == NULL broke callers that encode an empty buffer with dlen == 0, which used to write the NUL terminator and return 0. nmouha changed the PR to preserve existing well-defined behavior. nmouha also noted that the AVX2 path computes src + 0, which is undefined behavior when src is NULL. A separate draft, PR #33710, is titled "Check if EVP_EncodeBlock() returns an error".

## What to do before a fixed release ships

With no fixed release named in the sources, mitigation comes down to scope and input limits. These steps follow from what the sources establish:

- Find out whether any build, container or distro you ship uses OpenSSL from the 4.0, 4.1 or master branches. The PR labels name only those.
- Watch PR #33652 and the pending OpenSSL advisory for the merged behavior. Whether the final fix returns 0, returns -1 or asserts changes how your own error handling should look.
- Check your own code for calls to EVP_EncodeBlock() and EVP_DecodeBlock() that can receive caller-controlled lengths. Reject inputs above (INT_MAX / 4) * 3 bytes before calling EVP_EncodeBlock().
- Do not cast the return value to size_t without checking it. Both 0 and -1 are under discussion as failure values, and the OPENSSL_assert() option would abort instead of returning.
- Where scripts run openssl s_client, do not take -proxy_pass from untrusted environment variables. That is the one trigger the sources describe.
- One Hacker News commenter expects Arch and Fedora, which are already on 4.x, to receive a patch relatively quickly. No distro patch is confirmed in the sources.

The sources leave out the facts that would settle priority. They do not include the final advisory text, the list of affected release numbers, whether 3.x is in scope, or any server-side caller that base64-encodes more than 1.5 GiB of attacker-supplied data. Until the advisory provides those, the CVSS 9.8 label and bob-beck's view that the reproducer is synthetic point in opposite directions.

## Questions this raises

### Which OpenSSL versions are affected by CVE-2026-121481?

The fix PR #33652 is labelled for the master, openssl-4.0 and openssl-4.1 branches. The sources do not say whether the 3.x series is affected, so those branch labels are the only primary signal on scope.

### Is CVE-2026-121481 remotely exploitable?

The sources show no remote path. The only reproducer is local, passing a very large -proxy_pass to openssl s_client through an environment variable. A reviewer called the reproducer completely synthetic.

### Is there a fixed OpenSSL release for CVE-2026-121481?

No. The sources name no fixed release, and the PR describes the advisory as still pending. Maintainers were still debating the error contract for EVP_EncodeBlock() as of November 20, 2026.

## Key facts

- CVE-2026-121481 carries a CVSS score of 9.8; GitHub's vector in GHSA-83xj-7xh4-4p7x works out to 9.76.
- Fix PR #33652 was opened on November 10, 2026 and labelled for master, openssl-4.0 and openssl-4.1 on November 11.
- With a 32-bit int, EVP_EncodeBlock() overflows at 1,610,612,733 input bytes, about 1.5 GiB.
- The only reproducer in the sources is local: a very large -proxy_pass to openssl s_client, passed via env:VAR.
- As of November 20, 2026, maintainers still disagree on whether the fix returns 0, returns -1 or uses OPENSSL_assert().

## Sources

1. [OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-121481, CVSS 9.8)](https://github.com/openssl/openssl/pull/33652) - github.com

Discussion read (practitioners' reactions, not a source): https://news.ycombinator.com/item?id=50569226
