I think CVSS 9.8 is exaggerated. This is not remotely anywhere near as serious as Heartbleed. It's an internal function which will fail if its input is far too long, but exploitability rests on how untrusted input can reach it; the key word being "untrusted". E.g. if you operate a base64 encoding service on the Internet that just reads all the data into memory at once and calls EVP_EncodeBlock(), that's exploitable. If you have a protocol that involves a block of data with a 16-bit length field which is passed to EVP_EncodeBlock(), that's 100% safe.
For those wondering about TLS: speaking as someone who has written a TLS implementation, AFAIK neither base64 encoding nor decoding occurs in the protocol itself, and the longest length field is 24 bits (Hello stream). Certificate processing involves ASN.1 which does support arbitrarily-long integers, but that's a big hint to check that they're within a sensical range.
> Calling EVP_EncodeBlock() with an input length close to INT_MAX may overflow the calculation of the encoded output size and write past the end of the caller-supplied output buffer.
Haven't we suffered enough yet with lack of a basic feature in C? Why are enhancements going into C that never address this fundamental problem?
I wrote this proposal for C 17 years ago:
file:///C:/digitalmars/articles/C-biggest-mistake.html
It's a simple addition, it breaks 0 code, and provides a path forward to stop array overflows for good.
It's a foundational feature for D. We don't have buffer overflows.
I am not a system administrator, but I am getting a serious vulnerability fatigue, every single day there's at least two new vulnerabilities in major pieces of software, I'm just tired of seeing that everywhere and hearing that everywhere. Fellow system administrators must be having it much worse.
That's why it's recommended to use size_t for passing sizes of buffers. It's unlikely to get overflow with it. In this particular case input buffer needs to have size larger than half of address space in order to trigger overflow, which isn't possible (64-bit systems usually have only 48 bits of actual address space, 32-bit systems don't allow allocating so large blocks).
Seems like only OpenSSL 4 is impacted? What distros and systems use that?
I feel like in the post heartbleed era, a lot of people are not including new features of upstream openssl as much as they used to.
The more I see these posts, the more I'm convinced that "never reinvent the wheel" mentality we had so far in software engineering basically covered up a lot of lazy engineering, and we just pretended everything was fine. It's like these findings cross-pollinate.
What about LibreSSL, BoringSSL, WolfSSL, BearSSL? Are those vial replacement for OpenSSL. I know there was a lot of fuzz back then after HeartBleed, but how about these days?
Is this demonstrable? or a finding, that can be exploited?
So what's the timeline here? About a week ago (damn UIs that don't easily let you see the actual date) someone submitted a PR, but only two days ago the CVE was public. The PR is still not merged. Was the team let know in advance but ran out of time to patch or something?
OMG
[flagged]
Oh god, the discussion about fix is the most C thing ever, it makes the recent musl issue much more understandable:
- Let's return -1 for error
- People might not expect new -1 value, let's return 0
- How are clients supposed to differ between old 0 and new 0
Is this going to be the 39th 9.8 CVE that results in 0 websites getting hacked?
I need some of you people to get hacked so I have something to point to, or I won't be able to convince management that this is worth taking seriously for much longer.
So, uh, like, any word on what the "9.8" actually means? Is this "an obscure feature nobody has on could with a bit of luck and a cosmic ray strike allow arbitrary code execution if you're one of the few people using it" or is this "if you have a socket with OpenSSL exposed to the internet you're already compromised" or what?
if your threat model includes someone setting a 1.6GB proxy password, the base64 encoder isn't where you've lost
I think that’s enough Internet for me this week.
>>I am really worried about the negative return value being added. Existing third party callers might not be ready to handle this correctly (i.e. if they cast the return to size_t without checking). Could we instead return 0? (In all the added error returns in this PR.)
Rust fixes it.
If the first replies I got from maintainers were those I'd tell them to fuck off then and keep having a broken library. They are like stackoverflow curmudgeons and it's not surprising other libraries appeared - who would want to deal with this.
[flagged]
[flagged]
[flagged]
[flagged]
It feels to me the only way to beat LLMs finding vulnerabilities is to have LLMs (or LLMs paired with other AI methods) constantly monitor your infrastructure, traffic, database, etc. to ensure that nothing out of the ordinary is happening
I see the OpenBSD guys are all over the PR (deservedly) shitting all over the proposed fixes so I assume LibreSSL may be impacted? Or are they just providing free advice and color commentary?
[flagged]
On a very very quick read, the bug is that EVP_EncodeBlock malfunctions if the input is larger than ~1.5GB. EVP_EncodeBlock is a function that encodes base64.
https://docs.openssl.org/1.0.2/man3/EVP_EncodeInit/
As a seasoned C programmer, I can immediately observe that the whole API is bad: the caller is expected to calculate the buffer length on their own, using a nontrivial formula, and the caller does not pass in the output buffer length, so the implementation cannot validate it. But apparently OpenSSL 4 also implemented it wrong and wrote (possibly far) past the end of the buffer.
You should probably assume that, if you are running anything that can be convinced to use this API to encode a very long blob as base64, then you are in trouble. I don’t know why a modern server would do this.
BTW, OpenSSL seems to be a rather low quality implementation of a very low quality set of APIs. Stay away.
edit: Fixed my size threshold, hopefully. I was thinking of unsigned ints, but this is a signed int. I have not looked at the code, just the description.