Live data from Hacker News

OpenSSL: Stack buffer overflow in CMS AuthEnvelopedData parsing

openssl-library.org

31–40 of 52 posts

Re: OpenSSL: Stack buffer overflow in CMS AuthEnvelopedData parsing

#31
post #17
post #7

2026 and we still have bugs from copying unbounded user input into fixed size stack buffers in security critical code. Oh well, maybe we'll fix it in the next 30 years instead.

The bug isn't actually the copy but the bounds check. If you had a dynamically sized heap allocated buffer as the destination you'd still have a denial of service attack, no matter what language was used.

The actual vulnerability is indeed the copy. What we used to do is this:

1. Find out how big this data is, we tell the ASN.1 code how big it's allowed to be, but since we're not storing it anywhere those tests don't matter

2. Check we found at least some data, zero isn't OK, failure isn't OK, but too big is fine

3. Copy the too big data onto a local buffer

The API design is typical of C and has the effect of encouraging this mistake

    int ossl_asn1_type_get_octetstring_int(const ASN1_TYPE *a, long *num, unsigned char *data, int max_len)
That "int" we're returning is either -1 or the claimed length of the ASN.1 data without regard to how long that is or whether it makes sense.

This encourages people to either forget the return value entirely (it's just some integer, who cares, in the happy path this works) or check it for -1 which indicates some fatal ASN.1 layer problem, give up, but ignore other values.

If the thing you got back from your function was a Result type you'd know that this wasn't OK, because it isn't OK. But the "Eh, everything is an integer" model popular in C discourages such sensible choices because they were harder to implement decades ago.

Re: OpenSSL: Stack buffer overflow in CMS AuthEnvelopedData parsing

#33
post #16

Another "fix" in the long line of OpenSSL "fixes" that includes no changes to tests and therefore can't really be said to fix anything. Professional standards of software development are simply absent in the project, and apparently it cannot be reformed, because we've all been waiting a long time for OpenSSL to get its act together.

OpenSSL and other similar security substandard projects have process deficiencies that lead to similar bugs over and over again. They never seem to learn the lesson that doing the same thing and expecting a different result is stupidity and/or insanity.

Re: OpenSSL: Stack buffer overflow in CMS AuthEnvelopedData parsing

#36
post #17
post #7

2026 and we still have bugs from copying unbounded user input into fixed size stack buffers in security critical code. Oh well, maybe we'll fix it in the next 30 years instead.

The bug isn't actually the copy but the bounds check. If you had a dynamically sized heap allocated buffer as the destination you'd still have a denial of service attack, no matter what language was used.

A denial of service attack is a million times better than an RCE attack.

Re: OpenSSL: Stack buffer overflow in CMS AuthEnvelopedData parsing

#37

Very strange, as I type this both Bullseye and Bookworm are marked as fixed but Trixie isn't yet: https://security-tracker.debian.org/tracker/CVE-2025-11187

The correct URL is https://security-tracker.debian.org/tracker/CVE-2025-15467

You're pointing to one of the other security issues for which a fix was released today.

Re: OpenSSL: Stack buffer overflow in CMS AuthEnvelopedData parsing

#39
post #7

2026 and we still have bugs from copying unbounded user input into fixed size stack buffers in security critical code. Oh well, maybe we'll fix it in the next 30 years instead.

I recall Hoare,

"A consequence of this principle is that every occurrence of every subscript of every subscripted variable was on every occasion checked at run time against both the upper and the lower declared bounds of the array. Many years later we asked our customers whether they wished us to provide an option to switch off these checks in the interests of efficiency on production runs. Unanimously, they urged us not to they already knew how frequently subscript errors occur on production runs where failure to detect them could be disastrous. I note with fear and horror that even in 1980 language designers and users have not learned this lesson. In any respectable branch of engineering, failure to observe such elementary precautions would have long been against the law."

-- C.A.R Hoare's "The 1980 ACM Turing Award Lecture"

Guess what 1980's language he is referring to.

Then in 1988,

https://en.wikipedia.org/wiki/Morris_worm

It has been 46 years since the speech, and 38 since the Morris worm.

How many related improvements have been tackled by WG14?

Re: OpenSSL: Stack buffer overflow in CMS AuthEnvelopedData parsing

#40
post #37

Very strange, as I type this both Bullseye and Bookworm are marked as fixed but Trixie isn't yet: https://security-tracker.debian.org/tracker/CVE-2025-11187

The correct URL is https://security-tracker.debian.org/tracker/CVE-2025-15467 You're pointing to one of the other security issues for which a fix was released today.

TYVM for the proper URL kind sir!
Post reply on HN