OpenSSL developers have released a patch to fix CVE-2026-121481, a buffer overflow vulnerability in the EVP_EncodeBlock() function, according to a GitHub pull request.

The vulnerability has a CVSS score of 9.8, indicating high severity. The fix works by implementing OPENSSL_assert() calls for inputs that could lead to undefined behavior, rather than adding new error return values that might break existing third-party callers.
According to the pull request discussion, the developers initially considered returning -1 for invalid inputs, but faced concerns from maintainers about backward compatibility. Some reviewers worried that existing third-party code might not properly check for new error values, or could cast return values to unsigned integers without validation, potentially masking errors.
The patch also addresses similar vulnerabilities in EVP_DecodeBlock() and fixes an incorrect length check in the base64encode() function in http_client.c. Documentation has been updated and new tests added to document existing behavior for zero-length inputs.
During code review, maintainers discussed whether to use assertions or new error handling mechanisms. The final approach uses OPENSSL_assert() to catch invalid inputs—such as negative lengths or oversized data that could overflow—while preserving all existing well-defined behavior of the API. This avoids forcing third-party callers to handle new error conditions.
The patch also ensures that edge cases, like encoding or decoding empty buffers, continue to work as they did previously. Reviewers noted that the original issue may have involved synthetic test cases rather than real-world exploitable scenarios, but agreed the CVE should still be fixed to prevent potential future problems.
The solution represents a compromise between security hardening and API stability, focusing narrowly on fixing the documented vulnerability while maintaining backward compatibility with existing code that depends on these functions.
Key facts
- CVE-2026-121481 is a buffer overflow in OpenSSL’s EVP_EncodeBlock() with a CVSS score of 9.8
- The fix uses OPENSSL_assert() for invalid inputs rather than new error return values to maintain backward compatibility
- The patch also addresses similar issues in EVP_DecodeBlock() and fixes a length check bug in http_client.c
- Updates include documentation changes and new tests for zero-length input handling
