OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-121481, CVSS 9.8)
The base64 encoding function EVP_EncodeBlock() did not validate its inputs, so a caller passing a very large length could cause the encoded output size to overflow and write past the end of the output buffer. An attacker who can influence the length passed to this function, for example through a very large proxy password given to the s_client command, could trigger a buffer overflow.
github.com
Published on github.com
openssl-ci-bot Bot added the approval: review pending This pull request needs review by a committer label Nov 10, 2026
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the function did not check that the caller-supplied length was small enough for the computed encoded size to fit in an int, so the size calculation overflowed and the buffer was overrun.
Impact
A caller passing an oversized length could cause a buffer overflow; the text shows this is reachable from the command line by supplying a very large proxy password to s_client, though the password must come from an environment variable to avoid an over-long command line.
What the attacker needed
Caller passes an oversized length; large proxy password via env variable
The fix
The pull request adds input validation to EVP_EncodeBlock() so invalid inputs are rejected instead of overflowing, applies a similar guard to EVP_DecodeBlock(), and corrects the length check in the HTTP client's base64encode(); the text does not say it has been merged.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Base64 is a way of turning binary data into plain text characters. A function that does this needs to work out how much space the text will take; if it gets that sum wrong for huge inputs, it can write past the end of the memory it was given, which is a buffer overflow. That can crash a program or, in the worst case, let an attacker run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.