192 points by JacobHenner about 6 hours ago | 144 comments | View on ycombinator
amluto about 5 hours ago |
userbinator about 4 hours ago |
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.
ansipunk about 2 hours ago |
moezd about 2 hours ago |
VladVladikoff about 6 hours ago |
Panzerschrek about 4 hours ago |
asveikau about 5 hours ago |
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.
shepherdjerred about 4 hours ago |
jerf about 5 hours ago |
undefined about 5 hours ago |
sippingabonedry about 5 hours ago |
globular-toast about 1 hour ago |
m00dy about 5 hours ago |
Rust fixes it.
vasco about 1 hour ago |
charlie2agent about 1 hour ago |
yoy0721 about 4 hours ago |
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.