News for hackers. Stuff that matters.
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]