News for hackers. Stuff that matters.
Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1... by userbinator on Thursday November 19, 2026 @10:35PM (#50569831)
if the input is larger than ~1.5GB.

...on a system where ints are 32 bits. The bottom line is that this doesn't appear to be easily exploitable and IMHO it should be the callers of EVP_EncodeBlock which need to be inspected to determine the actual risk.

using a nontrivial formula

It's base64. 4/3 expansion; round it up and add padding. What's "nontrivial" about that?

and the caller does not pass in the output buffer length, so the implementation cannot validate it

Not necessary, because the caller is responsible for allocation.

Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1... by mrheosuper on Thursday November 19, 2026 @10:54PM (#50569945)
The question can be reduce to "who do the length validation".

In my case, if i write a public-facing API, i never trust the caller will do the correct thing, thus the caller must provide all the critical parameters, and i must validate all of them.

Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1... by userbinator on Thursday November 19, 2026 @11:50PM (#50570319)
The question can be reduce to "who do the length validation".

At the boundary where untrusted input becomes trusted. This is commonly known as the sanitisation/validation layer.

Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1... by amluto on Friday November 20, 2026 @12:04AM (#50570383)
> It's base64. 4/3 expansion; round it up and add padding. What's "nontrivial" about that?

If you mean ceil(inlen * 4/3) + 1 (even if you use exact arithmetic), then you are passing too small a buffer and you will overflow. Which, I think, proves my point.

You should not need to read the manpage of a function you are calling in order to determine whether you have passed a large enough buffer to avoid overflow.

Reading the manpage to get the function to not return an error would be a different story.

Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1... by userbinator on Friday November 20, 2026 @12:11AM (#50570428)
If you mean ceil(inlen * 4/3) + 1 (even if you use exact arithmetic), then you are passing too small a buffer and you will overflow.

If you let untrusted input reach inlen and overflow that computation, you have already failed:

https://news.ycombinator.com/item?id=50570319

Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1... by amluto on Friday November 20, 2026 @02:08AM (#50571148)
Are you saying that any code that base64’s a string of attacker-controlled length is a mistake?
Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1... by Pinus on Friday November 20, 2026 @02:23AM (#50571278)
I think userbinator thought that you meant that the calculation would overflow, while I think you meant that the calculation, even if not overflowing, would return the wrong value under some conditions and that subsequent code would then overflow the buffer.
Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1... by dns_snek on Friday November 20, 2026 @09:36AM (#50575222)
[delayed]
Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1... by sweetjuly on Friday November 20, 2026 @12:38AM (#50570568)
I am confused why you make out 32 bit int as being rare. Almost all devices that you'd reasonably connect to the internet at this point have int as 32 bits