Static

OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-121481, CVSS 9.8)

First reported by Github ·

The signal ●○○○ Compiled by AI from Github and Hacker News
Why you might care

OpenSSL's EVP_EncodeBlock() function will now reject invalid inputs with an error, preventing potential crashes or exploits.

What happened

A critical buffer overflow vulnerability, designated CVE-2026-121481 and assigned a CVSS score of 9.8, has been identified in OpenSSL's EVP_EncodeBlock() function. The vulnerability arises from improper handling of invalid inputs such as NULL or negative-length buffers, and cases where the encoded size exceeds the maximum integer value. A pull request on GitHub by developer nmouha proposes a fix that involves returning -1 for these invalid inputs, aligning with the behavior in wolfSSL's compatibility layer. The fix also includes a similar safeguard for EVP_DecodeBlock() and addresses an incorrect length check in the base64encode() function within http_client.c. New tests are being added to cover the updated functionality, and the changes are being documented. Exploitation is possible via specific command-line arguments to openssl s_client, particularly when using large passwords through environment variables. This vulnerability bears similarities to a previous OpenSSL issue, CVE-2021-23840.

What it means

The fix for CVE-2026-121481 introduces a stricter error handling mechanism in OpenSSL's base64 encoding and decoding functions. By returning -1 for invalid inputs, the library aims to prevent buffer overflows that could lead to denial-of-service or remote code execution. This change, while addressing a critical vulnerability, requires downstream applications to be updated to correctly interpret the new error codes, as a return value of 0 previously indicated success or no data processed. The discussion around returning 0 versus -1 highlights a tension between strict error signaling and backward compatibility for existing third-party integrations.

This vulnerability underscores the ongoing security challenges in foundational cryptographic libraries like OpenSSL, which are widely used across the internet. The potential for critical flaws in such core components necessitates continuous vigilance and rapid patching. Developers and system administrators should prioritize updating their OpenSSL installations to the patched version once it is released to mitigate the risk of exploitation. The incident also prompts a re-evaluation of how third-party software integrates with and relies upon the error handling of these libraries.

AI-written summary. May contain errors.

Buffer