Back to the notes

OpenSSL just shipped a 9.8 CVSS buffer overflow in base64 encoding

A critical buffer overflow in EVP_EncodeBlock() affects OpenSSL 3.4.0. The function that wraps your secrets in base64 can now write past the end of your buffer.

01equipment.jpg
Alice Wondrak-Biel / Wikimedia Commons. Resized and converted to WebP. Public domain

OpenSSL 3.4.0 shipped with a buffer overflow in EVP_EncodeBlock(), the function that turns binary data into base64. CVSS score is 9.8, which means it is bad. The bug is in the encoding path, not decoding. When you call EVP_EncodeBlock() to wrap a certificate or encrypt a payload, the function can write past the buffer you allocated. This is the kind of mistake that gets you remote code execution if an attacker controls the input size. What makes this interesting is that base64 encoding is supposed to be the boring part. You hash something, you encrypt something, then you base64 it so it survives email or JSON. The crypto primitives get the scrutiny. The encoding step is where you relax. OpenSSL 3.4.0 was released six weeks ago. If you upgraded to get the new FIPS module or the performance fixes, you now have a memory safety bug in a function that every TLS library calls a thousand times a second. The fix is already merged. The function now checks the output buffer size before writing. The patch is twelve lines. The bug was introduced when they refactored the base64 code to remove a deprecated API. This is what code reuse looks like in 2026. You inherit thirty years of OpenSSL API surface, you refactor to clean up the deprecated paths, you ship it, then someone finds the buffer overflow you introduced while making the codebase safer. If you are running OpenSSL 3.4.0 in production, you need to patch. The CVE is live, the diff is public, and attackers can read GitHub pull requests as well as you can. The reminder here is that memory safety bugs are not just in the parsing code. They are in the utility functions you call without thinking. Base64 encoding. URL decoding. String concatenation. The functions you assume are correct because they have been around since 2004.


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

Back to all notes

Behind the notes

Vikrant
Sharma.

Artificial Intelligence Engineer intern at Voxon Photonics in Adelaide. Studying a Master of Information and Communications Technology at UniSC, with a focus on data, machine learning and security.

Meet the person behind the work