OpenSSL EVP_EncodeBlock heap overflow (CVE-2026-121481)
OpenSSL CVE-2026-121481 is a heap overflow in EVP_EncodeBlock() with huge inputs; upgrade to 4.0.4 or 4.1.1 and cap input sizes.
- Published
- Fixed in
- OpenSSL 4.0.4, OpenSSL 4.1.1 (as reported by Cyber Security News from the CVE record; vendor package availability not confirmed)
- Exploitation
- No confirmed exploitation in the sources; the public fix pull request describes a command-line trigger, and the GitHub Advisory Database lists an EPSS score of 0.14%
Live scores
CVE-2026-121481- EPSS
- 0.001
low predicted chance of attack - VEDAS
- 0.513
likely exploited - On CISA KEV
- Not listed
- Detection rule
- Out of scope (local)
Live scores
CVE-2021-23840- EPSS
- 0.511
very likely to be attacked soon - VEDAS
- 0.983
strong exploit evidence - On CISA KEV
- Not listed
- Detection rule
- No public rule yet
What happened
The GitHub Advisory Database describes CVE-2026-121481 as follows: calling EVP_EncodeBlock() with an input length close to INT_MAX may overflow the calculation of the encoded output size and write past the end of the caller-supplied output buffer. The entry was published on Nov 18, 2026 with a CVSS 3.1 base score of 9.8 (critical) and lists CWE-122 (heap-based buffer overflow) and CWE-190 (integer overflow). It lists no package, and its affected and patched versions are “Unknown”. GitHub Advisory Database
Cyber Security News reports that the flaw can corrupt nearby memory or crash the application. It also stresses that the score describes potential severity and does not mean every service using OpenSSL is remotely exposed. The key question is whether an application passes large amounts of untrusted data to the encoder. Cyber Security News
A fix was proposed publicly in an OpenSSL pull request, opened by contributor nmouha. Its description says the OpenSSL security response team had asked for a public fix and that the advisory was still pending at that time. The patch makes EVP_EncodeBlock() return -1 for NULL buffers, negative lengths, and lengths whose encoded size does not fit in an int. It also adds a similar guard to EVP_DecodeBlock() and corrects a length check in base64encode() in http_client.c. The author says the pattern resembles CVE-2021-23840. GitHub: openssl/openssl pull request 33652
The author also says the bug can be reached from the command line by passing a very large -proxy_pass value to openssl s_client, supplied through an environment variable, and that GOST accepts such large passwords. GitHub: openssl/openssl pull request 33652
In the review thread visible in the source (up to Nov 13, 2026), the pull request was still open and maintainers were debating the error return. One maintainer worried that third-party callers might cast a negative return to size_t, and suggested returning 0 instead. The author and another contributor objected that 0 is a legitimate success value. A reviewer also asked that call sites such as PEM_SignFinal() and NETSCAPE_SPKI_b64_encode() check the new return value, and a maintainer said this should be a separate commit. The final merged form of the patch is not confirmed in the sources. GitHub: openssl/openssl pull request 33652
Am I affected?
Cyber Security News, citing the CVE version record, lists these ranges:
| OpenSSL branch | Affected | First fixed |
|---|---|---|
| 4.0.x | 4.0.0 through 4.0.3 | 4.0.4 |
| 4.1.x | 4.1.0 | 4.1.1 |
| 3.x | Outside the affected ranges in the upstream CVE record | Not applicable |
The GitHub Advisory Database entry lists affected and patched versions as unknown, so the sources differ in how much version detail they give. GitHub Advisory Database
Cyber Security News adds that these version numbers do not confirm a fixed package is available from a given vendor. It reports that Ubuntu’s security tracker rates the issue Medium and lists its main openssl packages as needing evaluation. It marks the nodejs package in Ubuntu 22.04 LTS as vulnerable, noting that this package embeds its own copy of OpenSSL, so checking only the system library can miss bundled copies. Cyber Security News
You are most likely to be affected if your own code calls EVP_EncodeBlock() with very large inputs, especially data from users or external services. Using OpenSSL for encrypted connections does not by itself answer that question. Cyber Security News
What to do now
- Inventory OpenSSL copies in system packages, containers, and application bundles, including software that embeds its own copy. Cyber Security News
- Check which of them run OpenSSL 4.0.0 through 4.0.3 or 4.1.0, and prioritize applications that Base64-encode data from users or external services. Cyber Security News
- Search your code for calls to EVP_EncodeBlock() and confirm which size limits apply before encoding begins. Cyber Security News
- Until a vendor-confirmed update is available, enforce application-level input limits before encoding. For large files, consider an encoding interface that processes data in chunks. Cyber Security News
- Update to OpenSSL 4.0.4 or 4.1.1, or the equivalent vendor package, once available. Restart or redeploy affected workloads and verify they run the updated build. Cyber Security News
- If you call EVP_EncodeBlock() or EVP_DecodeBlock() yourself, be aware that the proposed patch makes them able to return an error value for invalid input, and the exact return convention was still under discussion. Check your own return-value handling once the final patch is released. GitHub: openssl/openssl pull request 33652
Sources
- Cyber Security News: OpenSSL Hit by Critical 9.8 Heap Buffer Overflow Vulnerability in Base64 Encoding Function
- [GitHub: [NSF] [CVE-2026-121481] Buffer overflow in EVP_EncodeBlock(), pull request 33652](https://github.com/openssl/openssl/pull/33652)
- GitHub Advisory Database: Calling EVP_EncodeBlock() with an input length close to... (CVE-2026-121481)