Skip to content
Memory corruption Write-up Advanced

OpenSSL Said Low. The Aggregators Said 9.8. The Kernel Said 131 KB.

A base64 encoding routine in OpenSSL can overflow an integer and, at very large input lengths, write past the caller's output buffer. The author argues no attacker can reach the boundary through the command line because the kernel caps a single environment variable far below the required size, so the bug is real but only exploitable by an application that passes an oversized length itself.

Raj Namdev Follow

Published on medium.com

OpenSSL’s CVE record: “No path by which an attacker can trigger this has been identified.” The fix PR, written by the person who found it: “Exploiting this vulnerability from the command line is possible by passing a large -proxypass to openssl sclient.” The aggregator pages: 9.8, Critical.

Raj Namdev, on medium.com

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 encoder's int-typed length and return value overflow at large inputs, and the AVX2 loop condition wraps its counter at INT_MAX, so the documented sizing recipe and the loop bound both break at the same boundary.

Impact

The author concludes the 9.8 rating is unsupportable because the only claimed command-line route is blocked by the kernel's per-string environment limit, leaving a real but low-severity bug for applications that encode a 1.5 GiB blob themselves.

What the attacker needed

Caller passes ~1.5 GiB in one buffer; application uses EVP_EncodeBlock, not streaming; enough memory for input plus output

The fix

The fix guards the output length at `(INT_MAX / 4) * 3` and also patches the HTTP client's existing guard, but the author notes it will not stop an application from passing its own oversized length.

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. The OpenSSL function that does this takes a length as a normal signed number, and when the input is enormous that number can wrap around and produce a wrong size or a write past the end of a buffer. The catch is that you would need to hand the function about 1.5 gigabytes in one go, and the author shows the operating system will not let a command line or environment variable carry anything near that, so only a badly written program could actually trigger it.

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.

More by Raj Namdev

View all

9 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.