191 comments

  • amluto 7 hours ago ago

    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.

    • socketcluster 3 hours ago ago

      > BTW, OpenSSL seems to be a rather low quality implementation of a very low quality set of APIs.

      Fully agree with your assessment above that line, but damn, this is a strong statement for a library this ubiquitous. You wonder; how could this happen? And yet, as an open source developer myself, I know how little people care about code quality.

      • Gigachad 3 hours ago ago

        We have known this since at least heartbleed. The answer was that basically no one funds the project and it had only one developer.

        All these trillion dollar tech companies have been leaching off open source for free and never contributed back to the projects they rely on.

        • k_sze 3 hours ago ago

          Honest question: shall free software licenses be changed to force large corporations to sponsor free software projects adequately?

          • cowlevel 8 minutes ago ago

            Yes, they should do this. Howvee, they'd stop being considered free software and open source.

            Alternatively they can put such large share-back requirements that corporations don't want to use it and would rather pay for an alternate license. SSPL and to a lesser extent AGPL achieve this.

          • throwaway2037 an hour ago ago

            Many important open source projects have already switched to Business Source License. However, they only switched after they became famous. I have not seen any projects that became famous that started with BSL.

            • throwaway7356 14 minutes ago ago

              > Many important open source projects have already switched to Business Source License.

              No: first not "many", but very few. And second they are proprietary projects.

          • mike_hearn an hour ago ago

            A free software license is by definition a license that doesn't place requirements on anyone to pay for it, sponsor it, contribute or otherwise. If a license didn't grant these freedoms, it wouldn't be a free software license.

            What you're asking is, should widely used libraries be proprietary software sold for money? And that is indeed an honest question. There's a huge ecosystem of developers out there who say yes, there's nothing special about that idea at all.

            For example, on Apple, Google and Microsoft platforms you don't use OpenSSL when writing native apps. You use the vendor's cryptography APIs. The licenses of Windows and macOS force all users large or small to pay for them. On Android, the native crypto provider is Conscrypt:

            https://github.com/google/conscrypt/

            ... which is open source, but you will notice that it doesn't accept outside contributions and is funded by revenue from Android's proprietary components licensing. So that's very close to the model you're suggesting: it's "open source" but in practice large corporations pay Google lots of money for the privilege of shipping it.

            Moreover Google fund BoringSSL and other forks of OpenSSL. The issue here isn't funding levels (anymore). The issue is that OpenSSL is written in C, and not very good C at that.

          • ozgrakkurt 2 hours ago ago

            This is backwards imo, it is related to people that chose to build these projects. Everyone might have a different decision on it.

          • pbowyer 2 hours ago ago

            I certainly think so, but we who think this get shouted down because "It's not Open Source(TM)".

        • LytraX 2 hours ago ago

          Not allo companies loot OS projects with no contributions. M$ has contributes back to many OS projects and Google has dozens of OS projects themselves.

          And when Redis changed their license for such reasons, companies and people united to create ValKey or even the Centos/Rocky linux situation.

          • mradalbert an hour ago ago

            Redis cloud would cost you arm and leg compared to self hosting. I gives me an idea why big tech was not keen on making business with them

            • cowlevel 6 minutes ago ago

              AWS has 90% profit margins and still millions of customers.

            • mfru an hour ago ago

              big tech can spare a few arms and legs, though

        • socketcluster 3 hours ago ago

          It's insane. I maintain a small open source project with only about 100k downloads per week and so, in terms of funding, it's crickets for me but I assumed famous projects like OpenSSL would get some decent funding.

          Then I read articles about billionaires donating millions or even billions to various (sometimes frivolous) charities and I wonder WTF.

          The numbers just don't add up. It's like there is an invisible force field preventing people from donating money to open source?

          Crazy to think that the people who once posted a dumb viral 30-second meme video on YouTube probably got more money than the author of a complex, world-famous open source project which has been at the top for decades and which quite literally intermediates every aspect of almost every human's life.

          Does not compute.

          • throwaway2037 2 hours ago ago

            OpenSSL receives millions of dollars of funding each year. The corporation that runs the foundation reported 5.5M USD funding in 2024[1], and 5.0M USD funding in 2025[2]. These days, OpenSSL is well-funded.

            From your HN bio, I guess this is your project: https://socketcluster.io/

            From the home page, I see that you are sponsored by two different companies. To me, "in terms of funding, it's crickets for me" isn't an honest statement.

            If funding is such a problem for you, why don't you use a non-open source license, e.g., Business Source License? This would allow non-commercial projects to use your software for free, but commercial users need to pay. There are a bunch of big, important open source projects that already changed: HashiCorp, CockroachDB, MariaDB, etc.

            [1] https://openssl-corporation.org/blog/2025-02-14-annual-repor...

            [2] https://www.openssl-corporation.org/assets/Annual-Report-202...

            • josefx 26 minutes ago ago

              From my understanding the problem was never that OpenSSL had no money, but that all the money it had was tied to services and features that didn't help improve the libraries overall security and in some cases where even outright harmful.

            • throooooo 14 minutes ago ago

              I don't believe BSL = commerical issues have to pay. Typically it means that the code can be used internally, but not distributed or resold as a service.

            • Datagenerator an hour ago ago

              Interesting, three years no new Release necessary of SocketCluster? That must be quite stable, congrats!

          • avhception 2 hours ago ago

            I would very much like for my employer, who benefits massively, to donate. However, the people in charge of the money decisions don't know anything about software and don't want to be lectured by me. They have _important business stuff_ to do. Sigh.

          • drcongo 25 minutes ago ago

            If you're a white supremacist, you can get tens of millions donated to your dotfiles.

      • rwmj 2 hours ago ago

        If you've ever tried using OpenSSL you'll know that it's true.

        The API is a fractal of bad design. Not just that, but because of the API refusing to make sensible choices, it forces everyone using it to be an expert in cryptography, with predictable results for those programs that use it.

      • cowlevel 9 minutes ago ago

        Because you don't roll your own SSL.

      • yayachiken an hour ago ago

        SSL/TLS has always been a wonky and complicated standard built upon other wonky standards like x509 and ASN.1 (for PKI) that nobody would touch unless they are forced to.

        There is a reason why people did not do a lot of TLS (outside of anything involving monetary transactions) before Firesheep, the NSA leaks were the final nail in the coffin for unencrypted HTTP. On top of that Let's Encrypt and ACME did not exist, so TLS was behind a paywall on top of that.

        And then everything proliferated relatively quick even for tech standards. I guess people grabbed onto the next available tooling just like a drowning person would take any piece of driftwood.

        Not so fun fact: AFAIK the openssl binary was initially explicitly meant to be only used for testing. That is why its command line is so strange. It was initially meant to expose a couple of low-level primitives, not to implement workflows. One example would be the openssl-ca man page, which explicitly mentions this. People didn't care because unfortunately you could somehow do everything you could ever want with the openssl binary and I guess that is also something how the impression stuck that openssl is the most advanced library.

      • throwaway2037 2 hours ago ago

            > And yet, as an open source developer myself, I know how little people care about code quality.
        
        This is a weird statement. I am someone who has worked on closed-source internal enterprise software for my entire career. Universally, the internal source is worse that the numerous open source libraries that we use. If anything, open source has "more eyeballs" than closed source, so the code quality will be better.
      • alienbaby an hour ago ago

        I remember a long time ago reading openssl was dumpster file code quality wise. I guess it was just built that way and never improved.

      • topspin an hour ago ago

        > You wonder; how could this happen?

        It all came from a bad place. OpenSSL grew from primitives created by cryptographers. Cryptographers are great, and they make fabulous things. But almost none of the understand software development or care a great deal about the mundane matters of API design, or the obnoxious limitations of naively designed processing elements.

        Others have cited the documentation for EVP_EncodeBlock(). In the mind of a cryptographer, the text is perfectly clear and trivial, and they likely haven't exposed themselves for many years to anyone that can't read that exactly once and not immediately and correctly visualize the necessary formulae. Nothing wrong here at all. The fact that on real computers, numbers don't just scale to whatever value a computation requires is merely a defect in the design of the machine.

    • vlovich123 7 hours ago ago

      > BTW, OpenSSL seems to be a rather low quality implementation of a very low quality set of APIs. Stay away.

      We’ve known this for well over two decade since heartbleed yet for some reason Linux distros haven’t migrated off of it

      • dcrazy 6 hours ago ago

        For those too young to remember 2014, Heartbleed led to both BoringSSL and LibreSSL being forked from OpenSSL.

        • stock_toaster 4 hours ago ago

          And also led to Amazon's s2n-tls and libcrypto being released around 2015 too as I call.

          EDIT: found the release announcement - June 2015 - https://aws.amazon.com/blogs/security/introducing-s2n-a-new-...

          • anygivnthursday an hour ago ago

            AWS-LC[0] itself based on BoringSSL, it makes it feel safer for those behind ALBs (but looks like this CVE may not be TLS related).

            [0]: https://github.com/aws/aws-lc

            Edit: corrected fork to based on, I don't actually know if it was a fork and a repo just says based on

        • b112 3 hours ago ago

          I wonder. Realistically, Boring and Libre haven't taking off. I measure that by most use and default deploys. But with LLMs, we may be entering a new world.

          In that world, certainly some projects may be impervious to fixes. We've all seen projects that basically eschew all change, and ignore issue trackers, and are basically dead.

          But the ones which still live? Eventually this first wave of LLM derived fixes will get through the old churn. Presumably, code will improve dramatically. If that's so, OpenSSL will become "good code". And the same with old legacy projects which are still hanging around.

          Meaning... will legacy simply exist forever? Our two forks above will likely fade away, if openssl's code becomes clean as can be.

          • p_l 2 hours ago ago

            BoringSSL is somewhat widely used because Google baked it into their projects (and partially by Microsoft, I believe they made a FIPS variant of it and used it in Go?)

            LibreSSL had, IIRC, problem known as OpenBSD-itis. Or to put it bluntly, the developers didn't really care about any other platform. Plus I will admit that being the first and loud "we will fix openssl" they got linked with some loud PR that showed less understanding of code they mocked than OpenSSL developer who wrote it, and that's really impressive when you consider some of the mocked code fragments were results of developers never reading foundational documentation for a platform

            • rustyhancock an hour ago ago

              > LibreSSL had, IIRC, problem known as OpenBSD-itis. Or to put it bluntly, the developers didn't really care about any other platform.

              Well put. This is the crux of the issue.

              If you ever try to use libreSSL you rub up against so much friction that most projects would hammer out early.

        • morkalork 6 hours ago ago

          TIL it's 2036

          • wahern 5 hours ago ago

            To be fair, frustrations with OpenSSL long preceded Heartbleed. Heartbleed was just the final straw for those who forked libressl and BoringSSL.

            And to be fair to OpenSSL, it was one of the first widely used crypto libraries, along with Netscape's NSS. Setting aside the reasonablebess of the initial choices, the rapid uptake meant those choices were difficult if not impossible to completely unwind, particularly the style and typing of parameters and error reporting. Even today debates rage about signed vs unsigned, etc, in C and other languages. (But suffice it to say there are still alot of unforced errors, IMO, such as implicit output buffer sizes.)

      • DANmode 5 hours ago ago

        Not breaking userspace is more important than security………

        • Skunkleton 3 hours ago ago

          "not breaking userspace" refers to kernel development. OpenSSL is userspace.

          • yjftsjthsd-h 3 hours ago ago

            Paraphrasing to "don't make breaking API/ABI changes for projects consuming your API/ABI" doesn't materially change a reasonable point. (And I generally agree with that point, although I confess openssl specifically really strains my view)

          • charcircuit 3 hours ago ago

            And this is why the Linux Desktop will never go mainstream. You should never break apps at all, the OS's API surface goes beyond just the kernel.

        • vasco 3 hours ago ago

          Yeah, we all know users would rather be reliably hacked than unreliably safe.

          • cowlevel 3 minutes ago ago

            Users would rather risk getting hacked than have a computer that doesn't boot or doesn't go on the internet. If they preferred the latter they'd unplug it.

      • CrimsonCape 4 hours ago ago

        I just don't get it; this is a task to hand to an LLM, "go rebuild OpenSSL, use Rust (no mistakes)" and have it churn through a greenfield implementation. Then open a PR =). Why hasn't this happened yet? The fact that the LLM will write tests and deal with all the compiler errors probably puts it lightyears ahead.

        • brianpane 3 hours ago ago

          There’s already a Rust TLS library, rustls, that’s relatively mature (10 years in development, a couple of paid maintainers, robust development and release processes). It’s not a drop-in replacement for OpenSSL, though. There’s a companion project to build an OpenSSL-compatible wrapper API for it, but that’s not as far along. Interestingly, while rustls has a plug-in API that lets you choose your favorite Rust encryption library for the low-level operations (aws-lc-rs, Ring, Graviola, etc), those libraries all tend to contain a lot of assembly … not just for speed, but because it’s easier to avoid side channel timing vulnerabilities in assembly.

          • zelphirkalt 2 hours ago ago

            Can you explain why it is easier to avoid side-channel timing attacks in assembly?

            • jbarberu 2 hours ago ago

              Compilers like to make code go brrr as much as they can. With crypto you want the code to run at a deterministic speed (execution time), regardless of input. With hand written assembly you can (more easily) make sure you have the same cycle count regardless of what the input is.

            • tecleandor 2 hours ago ago

              I guess it's easier to control the timing of your operations if you write them directly in assembly. Otherwise, the compiler optimizations could change the code in unexpected ways.

            • HappMacDonald 2 hours ago ago

              At a guess, because it is easier to control timing in assembly than in a higher level language that will compile your source code into whatever shape it feels like

          • dralley 2 hours ago ago

            The side channels issue is where rust crypto libraries are currently the weakest

        • b112 3 hours ago ago

          LLMs have a bottleneck, human review. And human review is absolutely required at this stage (the future is unknown). A rust built LLM only reviewed SSL library would be a recipe for disaster.

          Beyond that, when it comes to exceptionally complex APIs, forward thinking implementation, and revising the 'way things are done'? These are weak points for LLMs. If you don't know how to write OpenSSL(or its replacement), and don't understand all its quirks, and the entire industry surrounding it, you cannot be the human driving the LLM successfully.

          There is no way for a human to catch all the design mistakes an LLM will make, otherwise.

          People seem to get upset, when I say this, for reasons I cannot fathom. However, we need to have a mental model of how we trust LLM output, and the 'new junior' is great for that. Especially considering that every day, is a new day for an LLM, its context window always loses yesterday.

          So consider LLMs as an eager, intelligent, incredibly well read junior, just out of college. And on their third day of work.

          Zero real world experience. Constant review required.

          Would you want that junior to design, build, and write test scripts for a library to underpin the entire internet?

          • pseudohadamard 2 hours ago ago

            > A rust built LLM only reviewed SSL library would be a recipe for disaster.

            There was a great quote at this year's OpenSSL conference that went something like "LLMs if left to their own devices will reinvent sendmail".

        • fock 3 hours ago ago

          you don't get credit for that because it is clear you are not very skillful at what AI-bros value most, namely manipulating other nerds...

          if you look at the commit history of OpenSSL, you can easily notice how a lot of people started contributing once their clanker got up to speed. They are very happy to rip out weird C and replace it with assembler or intrinsics. Rip out lists of characters formatted as a single string and replace them with array syntax, each char quoted.

    • teunispeters 6 hours ago ago

      I like to declare that industry coding standards such as MISRA exist precisely because code bases like OpenSSL (specifically) exist, as it's such a good example of breaking every sensible rule in the standards.

    • mort96 6 minutes ago ago

      I've been annoyed by writing code against OpenSSL's APIs before, precisely because it expects me to provide "appropriately sized buffers" without documenting the correct way to compute the correct size very well.

    • ozgrakkurt 2 hours ago ago

      Even the discussion in the PR about not handling the errors in all call-sites is revealing imo.

    • octoberfranklin 6 hours ago ago

      This is really embarrassing because this isn't even ancient code.

      OpenSSL has been around a long time and has a lot of legacy code, but this is in OpenSSL 4.x only -- stuff that was written in the last ~year.

      If they don't have the manpower to write new code safely they should just stick to maintaining what they've already written.

      • kroeckx 33 minutes ago ago

        This function has been there since the first commit in git history, from 1998.

      • fock 3 hours ago ago

        and now guess who helped writing this code. the chicken are coming home to roost, but people who are happy about their youthful productivity or stock packages will not be able to notice...

        the code before this PR included the check. But that was old code!

    • gspr 3 hours ago ago

      > BTW, OpenSSL seems to be a rather low quality implementation of a very low quality set of APIs. Stay away.

      Well sure, but the world doesn't seem to be able to agree on, or put resources into, a strong contender.

      I'm usually for heterogeneity and diversity in the software ecosystem, but for cryptography I'd be happy with a single high-quality "anointed path". Because cryptography.

      • cowlevel a minute ago ago

        other commenters mentioned boringssl (used in Go?), LibreSSL (used in BSD), rustls (used in Rust)

    • ronfriedhaber 6 minutes ago ago

      > BTW, OpenSSL seems to be a rather low quality implementation of a very low quality set of APIs. Stay away.

      Well, it depends. if in the coming weeks many more Heartbleed-level vulnerabilities would be exposed, {Amazon, Google, OpenAI, Anthropic} can just rewrite it in Rust, formally verified.

      There does not exist such implementation as of now as OpenSSL was good enough, AI may expose so many security flaws it would no longer be good enough.

    • kvuj 7 hours ago ago

      > EVP_EncodeBlock() encodes a full block of input data in f and of length dlen and stores it in t. For every 3 bytes of input provided 4 bytes of output data will be produced. If dlen is not divisible by 3 then the block is encoded as a final block of data and the output is padded such that it is always divisible by 4. Additionally a NUL terminator character will be added. For example if 16 bytes of input data is provided then 24 bytes of encoded data is created plus 1 byte for a NUL terminator (i.e. 25 bytes in total). The length of the data generated without the NUL terminator is returned from the function.

      My god, you only see this type of horrendous API in C don't you.

      • Ekaros 2 hours ago ago

        It makes lot of sense when you think what encoding here does. Changes 3 arbitrary bytes to 4 bytes with only some values being possible. Null termination is one issue, but the output is a string such only length of the text itself makes sense.

      • cesarb 5 hours ago ago

        > My god, you only see this type of horrendous API in C don't you.

        This is the appropriate place to put a link to this pair of classics on API design:

        "How Do I Make This Hard to Misuse?" https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html

        "What If I Don't Actually Like My Users?" https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html

      • userbinator 7 hours ago ago

        What's "horrendous"? I don't see anything which stands out as being wrong. It specifies exactly the lengths of input and output.

        gets(), on the other hand, that is "horrendous".

        • amluto 6 hours ago ago

          Even in C, if you have a function that takes an input buffer and output buffer of differing lengths, the right API has the caller pass both lengths.

          But yes, gets is worse.

          • userbinator 5 hours ago ago

            takes an input buffer and output buffer of differing lengths, the right API has the caller pass both lengths.

            If there is no fixed relationship between the two, then that makes sense; but in this case there is a very simple and well-defined relationship between them. But to specify two lengths which must always agree; and if not, then what? You've effectively invented an additional artificial error condition, an additional branch, and burdened all the callers up the chain to do something, which is a treacherous path to complexity and the production of even more bugs.

            Or are you just preaching the same mindless idiocy that lead to Microsoft's memcpy_s() (the "s" is for "stupid")?

            • baq 2 hours ago ago

              The artificial error condition is the whole point and the hoops you have to jump through to be able to reach it as you say are reasons to not use C because it’s hard to enforce invariants like this and easy to ignore them with mostly working code. Mostly working was fine last year, it isn’t anymore.

        • IanCal 3 hours ago ago

          The thing that jumps out to me is that it returns “the size of the output data minus one” but if I’m passing in a pointer it’s on me to make sure there’s enough memory allocated isn’t it? So the caller must make sure it’s calculated this correctly - in which case why return the size? Taking the size as an argument could be safer as you’d be checking the caller calculated enough space too.

          (Honest questions in this it’s probably been 20 years since I did c)

          • zzril 2 minutes ago ago

            That part of the API seems particularly random indeed, especially when comparing it to other EVP_{En,De}code* functions which use the returned int for success/error.

            The only reason for such a design I could think of is that the caller would be able to "detect" the overflow by comparing the returned value against the length of the buffer. But that is of course pointless, as the compiler is free to assume a buffer overflow cannot happen and thus optimize the check away...

        • kvuj 7 hours ago ago

          Perhaps I'm just used to having programmed in C# professionally for a little bit, but these sorts of APIs where you have to do a calculation to determine the destination buffer size make me feel like a caveman. A minuscule typo and you get a CVE like this.

          I know, I know, C is low level and high performance, but surely in the year of our lord 2026, we could have come out with something simpler.

          Horrendous is a strong word, you're right.

          • uecker 4 hours ago ago

            One can abstract buffer handling away in C just fine, eliminating all those problems. I don't know why programmers insist on open-coding low-level buffer management.

            • eptcyka 4 hours ago ago

              Yes, of course, this isn’t C, this is just another case of people writing C wrong.

              • stavros an hour ago ago

                Perhaps we could use another language, where it's not so easy (or possible) to write it wrong?

          • Ono-Sendai an hour ago ago

            The proper way to do it is to factor out the length calc into a utility function that the API provides. Also the calculated buffer length is passed in to the function, and an error is returned if it's too small.

          • pjmlp 3 hours ago ago

            Not even that is usable as excuse, only those that never tried out the systems programming languages that either predated C, or where equally developed during the 1970's outside Bell Labs and UNIX ecosystem.

            You could have come with something simpler in PL/I.

          • JSR_FDED 4 hours ago ago

            You should be comparing with assembly language, not C#.

      • td521534f12 6 hours ago ago

        "No way to prevent this" say users of only language where this regularly happens

        https://xeiaso.net/blog/series/no-way-to-prevent-this/

    • landr0id 6 hours ago ago

      >As a seasoned C programmer, I can immediately observe that the whole API is bad: the caller is expected to calculate the buffer length in 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.

      Many such cases.

      I expect we'll see some fun libyuv bugs soon in applications which decode media. The APIs are begging for misuse.

      https://chromium.googlesource.com/libyuv/libyuv/+/refs/heads...

    • Gibbon1 3 hours ago ago

      What's obnoxious is the WG14 standard committee could have at any time in the last 40 years provided a standard slice and buffer type that would go a long way to discourage trash API's like this one.

      I swear it's de rigueur in C that if an operation requires 5 parameters to insure the operation is error free than the function shall only take 4 parameters.

      Rewriting the function with idiot mode disabled

      int EVP_EncodeUpdate(EVP_ENCODE_CTX ctx, buffer_t out, const slice_t in);

      • adev_ 3 hours ago ago

        > What's obnoxious is the WG14 standard committee could have at any time in the last 40 years

        Or just use bloody C++ that solved that years ago with std::span.

        Unfortunately, many C dev prefers whining about "How horribly bloated" C++ is instead of using the part that makes sense.

        • Gibbon1 2 hours ago ago

          There are very few reasons to start a greenfield project in C++ at this point.

          • adev_ 2 hours ago ago

            There are plenty of reasons to start a greenfield C++ project in 2026.

            Providing C compatible APIs is one of them.

            However, I do not see any reasons to start a plain C user space project in 2026. Excepted if you are embedded / kernel dev.

            Everything advantage you do have in C (portability, compatibility, memory control).... you have them in Modern C++, but better.

            • TuxSH an hour ago ago

              > embedded

              Nintendo has been writing their OSes (3DS and Switch 1/Switch 2) fully in C++ (microkernel included), so not even this is an excuse to use C over C++.

        • 0points 2 hours ago ago

          The world would be better off without yet another newly slopped C/C++ app.

    • baq 3 hours ago ago

      One of the ‘rewrite it in rust’ projects that should really cause anyone to be offended IMHO.

      • p_l 2 hours ago ago

        The problem with "rewrite this in Rust" is more that Rust has laughable amount of Tier 1 platforms.

        Now, rewrite in Ada, given that GNAT supports the same targets as rest of GCC...

        • baq 2 hours ago ago

          Completely agreed but I’ll take any improvement at this point however small

    • 0xbadcafebee 2 hours ago ago

      > I can immediately observe that the whole API is bad

      I see this is your first time reading OpenSSL code

    • userbinator 7 hours ago ago

      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.

      • sweetjuly 4 hours ago ago

        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

      • amluto 5 hours ago ago

        > 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. Maybe your “add padding” part fixes it? In any case, I think that the fact that this confusion is even possible 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.

        • userbinator 5 hours ago ago

          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

          • amluto 3 hours ago ago

            Are you saying that any code that base64’s a string of attacker-controlled length is a mistake?

            • Pinus 3 hours ago ago

              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. (As for what I think about the actual issue, I’m too sleepy to even try. Which is probably an indication of something. =) )

      • mrheosuper 6 hours ago ago

        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.

        • userbinator 5 hours ago ago

          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.

  • userbinator 6 hours ago ago

    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.

    • tptacek 6 hours ago ago

      (I'm a broken record on this so I'll keep it brief). The problem here is that the CVSS score is in the headline, as if it meant anything. But CVSS doesn't mean anything. It's a Ouija board; VR people jack it up to get attention, vendors nerf it to chill their customers out.

      Someone should design something better, and less malleable.

      • csnover 6 hours ago ago

        A few years ago I participated in a study[0] about CVSS and apparently was very much in the minority in feeling that these scores are essentially useless. I have no idea what would actually shift the majority’s opinion on this, but I will at least echo your sentiment that everyone deserves something better.

        [0] https://arxiv.org/abs/2308.15259

        • tptacek 6 hours ago ago

          It's not an out-there opinion among vulnerability researchers, though.

      • vasco 3 hours ago ago

        CVSS would be fine if they shared full vector rather than adding up the score. The vector is representative of what. Going from what to "how bad" through making it a single number is where they messed up because the weights usually don't make sense from case to case.

        • JJJollyjim 2 hours ago ago

          I don't see that being at all helpful in this case. Which part of the vector conveys "this is a library function, so everything from the attack vector to authentication requirements to impact depends on how your application is utilising it, if it is at all"? For a bug like this, anything you select for into those fields is a stab in the dark.

      • userbinator 5 hours ago ago

        I think tiny pieces of isolated code like this function simply cannot be assigned CVSS scores, because it's missing all the context and threat model around how it is used.

        Then again, given that I once had to respond to a report which assigned a similar amount of severity to the strlen() function claiming that it will read beyond its bounds if its input is missing a null terminator (DUH!), I'm not surprised at the lack of critical thought among a certain population in this industry.

      • solyin 5 hours ago ago

        At the end of the day, sysadmins care about "how fucked am I" from an email subject line. A replacement system would be "let me run a daemon on your network telling me what you run" with vendors telling me about the vulnerabilies and I'll tell you if you (the sysadmin) give a shit. Technically that's trivial, but who's gonna trust me to run a daemon like that on their network. Maybe you'd have luck with your public history, but that seems like quite the uphill battle.

        • JJJollyjim 2 hours ago ago

          There are several products like that (Tenable comes to mind). Having used them, I would disagree that "telling you how fucked you are" is straightforward, because they all do a terrible job!

          They will statically determine (e.g. by SSHing in and rummaging around) that a library with a known vulnerability exists on the filesystem, but determining the reachability of that bug in the system as a whole (can this be exploited by the entire internet, or 3 sysadmins, or no one at all?) is not really an automatable task.

          • fc417fc802 2 hours ago ago

            What if we standardized some sort of representation of known vulnerable combinations instead of a numeric score? As well as a standardized way to record system state regarding which libraries are used together and which of the resultant application stacks have network access or whatever else. That sort of data could be readily analyzed by automated tooling.

    • nizbit 19 minutes ago ago

      Time is a construct. CVSS is a vibe.

  • chillax 30 minutes ago ago
  • MarekKnapek 7 minutes ago ago

    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?

  • ansipunk 4 hours ago ago

    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.

    • wry_xy 3 hours ago ago

      I see bugs being patched, and software improving. Bring em on.

      • polycaster 2 hours ago ago

        I see the Kessler Syndrome play out at work.

        • ansipunk 2 hours ago ago

          Are you implying that patching vulnerabilities will lead to more vulnerabilities? How so?

      • fock 3 hours ago ago

        this bug was introduced by clankers most likely...

        • lionkor 3 hours ago ago

          likely based on what

          • fock 2 hours ago ago

            - version 4 got released this year

            - mid 2025 a lot of people appeared contributing out of nowhere

            - https://github.com/openssl/openssl/pull/29178 this rewrote the code for base64 - you can delve into it to check if this was human generated.

    • ImHereToVote 3 hours ago ago

      This will lead to LLMs being embedded 24/7 into critical infrastructure. A "living" firewall and sysadmin.

      • yfontana 2 hours ago ago

        We could it call it a Blackwall

    • slekker 3 hours ago ago

      The solution is {Open,Net}BSD

    • raizer88 3 hours ago ago

      Don't tell me. I work for a bank and we have automated vuln checks on our code and dependencies and we can't release in pre-prod if we don't fix the cves. Basically since last year is 1 day you deploy new code and 2 days you deploy cve fixes.

      • jve 2 hours ago ago

        That's a great process for a bank!

  • VladVladikoff 7 hours ago ago

    :/ I really need a day off from patching servers.

    • roygbiv2 3 hours ago ago

      Same! Just did a whole bunch of out of band patching, more on the weekend. Fun times.

    • pixl97 7 hours ago ago

      Sorry buddy, back to the server mines for you!

      And yea, I'd really like a day where I'm not writing an email to customers about what they do and don't need to update regarding our software.

    • staplehorse6553 4 hours ago ago

      If you stopped patching servers, you wouldn't be affected. Always use trusted, 5-10+ years old code.

      • fc417fc802 2 hours ago ago

        Just stick to windows xp sp1 indefinitely. Those were simpler times. /s

    • txdv 5 hours ago ago

      call in the agents

  • Panzerschrek 6 hours ago ago

    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).

    • wahern 5 hours ago ago

      Not everybody recommends size_t. There's a sizeable community of people absolutely convinced most integers, including length and capacity integers, should be signed. And they stick to their guns even for C and C++. They have some very compelling logical arguments on their side, but IMO in languages like C and C++ they're just fatally unrealistic.

      • ozgrakkurt 2 hours ago ago

        This is anachronistic imo. There is no point of using signed or larger than needed integers when programming in a modern way.

        You have fuzzing, test coverage checks, overflow checks, static analysis, llm review. There is no conceivable reason why you might have a problem with using an u16 for a buffer length.

        Even reading the PR comments shows that these libraries are just really low quality.

        They are discussing if they should check the error return on callsites now that they made a function fallible.

        Even a library like openssl using raw arithmetic operators all over the place is just weird imo. Every arithmetic operation should be checked version of the operation unless there is a provable performance hit. Languages should just not have operators

      • uecker 4 hours ago ago

        Why unrealistic? I was in the unsigned camp a long time ago and switched to signed types for indexing and sizes, and this made many problems go a way.

        There was just a nginx issue that highlights how problematic the use of unsigned is in this context: CVE -2026-123007

        • reillyrider 2 minutes ago ago

          Why would anyone prefer signed for indexing and sizes?

          With unsigned you only need one check: 'i < bound', it works always, regardless how i is computed, and it doesn't matter if the calculation overflowed or wrapped around, still works.

          With signed you need: 'i >= 0 && i < bound', and you need to be very careful how you calculate i because overflow is undefined behavior.

        • wahern 3 hours ago ago

          From a brief look, I'd say there were several wrong turns made that led to the CVE-2026-123007 overflow bug.

          For why I think it's unrealistic to go all-in on signed integers in C, it's because sizeof is unsigned, and most APIs dealing with lengths use size_t, and there are many pitfalls when mixing signed and unsigned types.

          But I agree that there's a good case for using signed for the task behind that CVE. As I said, there are compelling reasons.

          OpenSSL is a case study in the pitfalls with mixing signed and unsigned in C code. A major reason is the careful dance it has to do mixing signed and unsigned, and it stumbles. There's no substitute for being careful with arithmetic, and at least for me, when I expend that effort I also tend to use overflow checking APIs, clamping, etc, because it's less prone to error. Do that and the benefits of signed start to disappear, or at least the debate starts to lose relevance. Why OpenSSL doesn't create and use a set of overflow checking routines is beyond me as it would simplify an incredible amount of very hairy and brittle code.

      • jurf 2 hours ago ago

        ssize_t

    • m00dy 6 hours ago ago

      never say never :)

  • asveikau 7 hours ago ago

    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.

    • CER10TY 3 hours ago ago

      Considering OpenSSL 4.2 is the first proper 4.x LTS release, I think most distros will still be on OpenSSL 3.x so not impacted.

      Bleeding edge distros like Arch/Fedora are already on 4.x, so they'll be impacted, but they should also receive a patch relatively quickly.

    • daemonologist 7 hours ago ago

      Well, Fedora 45 (with which I am composing this message).

      Fortunately it doesn't look like I need to patch anything at work though.

    • agilob 3 hours ago ago

      Arch

          pacman -Q  | grep openssl
          openssl 4.1.0-1
          openssl-3 3.5.9-2
  • moezd 3 hours ago ago

    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.

    • stellalo 3 hours ago ago

      Not reinventing the wheel is fine. But one should change tires every now and then!

      • kugelblitz 2 hours ago ago

        More like, we used to kick the tires and do manual inspections with a flashlight, now we have an automated tire checking system with multiple sensors that's uncovering stuff that manual inspections didn't see.

    • fock 3 hours ago ago

      that bug likely came from reinventing the wheel

    • GalaxyNova 3 hours ago ago

      Whaat? You want me to implement left-pad on my own? /s

  • ankit84 37 minutes ago ago

    Is this demonstrable? or a finding, that can be exploited?

  • shepherdjerred 6 hours ago ago

    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

    • mborch 18 minutes ago ago

      Or use defense in depth. There will be a vulnerability in every layer with some non-trivial probability, but rarely in multiple layers at the same time.

    • tptacek 6 hours ago ago

      I think so too; I think apart from pushing vulnerability research forward (which is important on its own merits just for computer science reasons), the major engineering challenge of this moment is figuring out how to make platforms resilient without rewriting everything; that could be better live-patching, it could be some weird monitoring thing, it could be automatic segregation and workload isolation.

      It's not "just keep up with the patches". That's going to be a losing strat.

      • NoDodgeQuestion 22 minutes ago ago

        maybe today, you cant keep up, 2 year later, AI rewrite everything safe in rust, you wont need patch everday

    • fauchletenerum 4 hours ago ago

      I'm not sure how cost effective or even viable that option would be. I think the only practical defense is some kind of baseline hardening at the OS or application level. Something like eBPF rules i.e. what Cilium Tetragon policies provide. Basically it seems like there's no way to guarantee that your application code can't be exploited in some novel way so your best option is to restrict them as much as possible.

      • shepherdjerred 3 hours ago ago

        I'm really just talking as a layman here.

        My feeling is that if we use traditional security approaches that seems like a losing strategy. You cannot just keep patching. I mean obviously you should, but that is not enough.

        LLMs are finding zero days in operating systems, language runtimes, everything. They will definitely be finding holes in your API. It is not a question of 'if'.

        • fauchletenerum 2 hours ago ago

          I agree that patching is just plugging holes in the dam with your fingers. I think the only viable defense is something more low level in the kernel. SELinux, eBPF, or something new and more sophisticated than those. A lightweight agent passively monitoring system calls and detecting anomalies perhaps?

      • fc417fc802 2 hours ago ago

        > there's no way to guarantee that your application code can't be exploited in some novel way

        As a thought experiment if this hypothetical application code were written in something resembling haskell I suspect it would actually prove fairly difficult if not impossible to find novel ways to exploit it. I think at that point an attackers only options are logical inconsistencies in the underlying business logic (see that one NASA rocket) or bugs in the compiler and runtime.

    • leptons 3 hours ago ago

      When Plex got hacked and my linux server had a cryptominer installed, I had no clue where to start fixing it. I loaded up Claude to analyze the system logs, and it told me what commands to run (and why) and the infection was gone in about 10 minutes. There's no way I would have known the many things I needed to do to fix and secure the system. I'm fairly new to Linux, and without the AI I would be helpless with some of the tricky things.

      • kryptiskt 3 hours ago ago

        The right thing to do in that case is to save whatever data you need from the server and then nuke it thoroughly, which means all the disks should be wiped, don't keep the old UEFI partition around, and reinstall. It would be preferable to skip the first step and get the data from a source that wasn't compromised, but sometimes you have bring out the hazmat suits to recover stuff from compromised systems.

      • shepherdjerred 3 hours ago ago

        This is very reactive though -- imagine you were a business. You'd be screwed. Your data is already gone.

  • sorrywhat 43 minutes ago ago

    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.

  • hinkley an hour ago ago

    I think that’s enough Internet for me this week.

  • jerf 7 hours ago ago

    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?

    • fulafel 4 hours ago ago

      This was possibly a rhetorical question but apparently it goes something like this - just a simple formula someone came up with that tries to model badness:

        # Hardcoded weights for AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
        attack_vector = 0.85        # Network
        attack_complexity = 0.77    # Low
        privileges_required = 0.85  # None
        user_interaction = 0.85     # None
       
        confidentiality = 0.56      # High
        integrity = 0.56            # High
        availability = 0.56         # High
      
        impact_sub_score = 1 - (1 - confidentiality) \* (1 - integrity) \* (1 -  availability)  # -> 0.91 
        impact = 6.42 \* impact_sub_score                                                       # -> 5.87
      
        exploitability = (
          8.22 \* attack_vector \* attack_complexity \* privileges_required \* user_interaction)  # -> 3.88
      
        score = impact + exploitability                      # -> 9.76
      
      (using Github's values from https://github.com/advisories/GHSA-83xj-7xh4-4p7x)

      Interesting that the impact calculation treats C, I, A as equal. And of course a lot of those inputs are just human(?) supplied vibes and/or context dependent in your use case.

      • arch-choot 3 hours ago ago

        CIA psyop confirmed? (/s)

    • pixl97 7 hours ago ago

      So this might be very similar to Java4shell, though will need to be verified.

      This is another base64 encoder where it takes a blob and coverts it to base64. I'm assuming an attacker control bit of data could be passed to the function which then overflows. Not sure if it can attempt to control a valid address or not, but unlocked AI likely could pretty quick.

  • metaphoric 37 minutes ago ago

    OMG

  • globular-toast 3 hours ago ago

    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?

  • sippingabonedry 6 hours ago ago

    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?

    • collinfunk 6 hours ago ago

      I'm not really involved in OpenSSL, aside from a few tiny changes and commenting on a few things that affected GNU coreutils. However, I have seen Bob, whom I assume you are referring to based on the profile picture, participate in many discussions. I wouldn't infer too much from it.

      • bentley 4 hours ago ago

        Bob is a member of the Engineering & Standards team at the OpenSSL Corporation.

        https://openssl-corporation.org/leadership.html

      • sippingabonedry 6 hours ago ago

        Do the projects collaborate closely since the split? My history is admittedly fuzzy.

        Sometimes the fix can be worse than the bug. Like patching a hole in the wall.

        • wahern 5 hours ago ago

          Yes, they collaborate. BoringSSL and libressl especially, which IIRC share some of the same developers. But OpenSSL has it's own priorities and vision, which sometimes (often?) clashes with the sensibilities of the BoringSSL and libressl developers. Because OpenSSL is still the de facto standard bearer and developer target, it can get frustrating for the libressl and BoringSSL developers, especially when they zig and OpenSSL decides to zag.

    • aaronbwebber 3 hours ago ago

      Describing the comments on this PR as "shitting all over the proposed fixes" seems wildly out of proportion? This is direct, productive feedback on a PR that led to a consensus and approval on an appropriate fix in ~a week, we don't need to make the OS process sound worse than it is.

      • Ekaros 2 minutes ago ago

        To me it looked like entirely reasonable discussion. Return one value or return an other value. And which one should be chosen based on what is in general expected. And then also consider what parts of code can this sort of change impact.

        I really find sad how far we have gone. Purely technical merits of a fix should always be an open conversation.

    • bjoli 2 hours ago ago

      Isnit a cultural, maybe: i found bob to be constructive and to the point.

    • bvttf 6 hours ago ago

      I think the second, LibreSSL was forked before OpenSSL v3 and this only impacts OpenSSLv4.

  • m00dy 7 hours ago ago

    >>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.

    • layer8 7 minutes ago ago

      Rust does not fix existing third party callers.

    • bjoli 2 hours ago ago

      Sometimes I like to think of how little performance would be lost and how much would be gained by just collectively deciding to use Option/Result instead of sentinel values.

      Things like the dumb (not like I'm any individual being dumb. Just collective accumulated stupidity) a*hole vulnerability some weeks ago. That wasn't even performance sensitive.

    • sippingabonedry 6 hours ago ago

      Be sure to let us know when your equivalent Rust crypto library is available.

      • m00dy 6 hours ago ago

        we don't need many crypto libraries, maybe just one for the whole world, written in Rust and then all functions are math-proofed.

        • uecker 3 hours ago ago

          A crypto library written in Rust would not be available everywhere, so can not be the only one. And if you formally verify the code, you can also formally verify that it is memory safe, so there is not much point to have it in Rust. Crypto has properties which may be difficult to verify though.

          If you want a safe interface that does not require passing random sizes around in extra arguments, this can also be done in C.

          • m00dy 44 minutes ago ago

            it's too late for C/C++ developers.

        • _ache_ 3 hours ago ago

          It's not just "math-proofed". You need a lot more to be a crypto library.

          Like time-constant, and it's hard to be time-constant in a performance optimised language like Rust. LLVM is doing some magic, and you don't want any magic in a crypto library.

        • td521534f12 6 hours ago ago

          You'd probably need a second one for FIPS.

        • staplehorse6553 4 hours ago ago

          Does the alpha-stage WIP code you call 'Rust' compile for 32-bit yet? No? Ok.

      • cyberax 5 hours ago ago
  • vasco 3 hours ago ago

    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.

    • globular-toast an hour ago ago

      What in particular do you find disagreeable here?