r/programming • • Apr 09 '14

Theo de Raadt: "OpenSSL has exploit mitigation countermeasures to make sure it's exploitable"

[deleted] — view deleted post

2.0k Upvotes

661 comments sorted by

View all comments

154

u/muyuu Apr 09 '14

Yep looking at that part of the code was a bit of a WTF moment. Also, there's a variable called "payload" where the payload length is stored... what kind of monster chose that name, I don't know.

23

u/alektro Apr 09 '14

So if you were to look at the code before this whole thing started you would have recognized the problem? The code is open source after all.

23

u/muyuu Apr 09 '14

Maybe. But this is code that entered OpenSSL 2 years ago.

And in any case one doesn't simply go reading the whole code running in systems. Literally by the time you finish there's a dumpload of new code to check. You'd never finish.

But I'd have expected that important stuff like this was more scrutinized by security people. It was found... 2 years later.

11

u/[deleted] Apr 09 '14

But I'd have expected that important stuff like this was more scrutinized by security people. It was found... 2 years later.

And this right here is critical to understand whenever anyone tries to make the argument that open source is safer just because it's open source. The source has to actually be audited by someone with sufficient qualifications.

3

u/muyuu Apr 09 '14

Had it bee close source and the vulnerability would have been found, with the difference that a fix could not have been proposed by the same people who found it.

Closed-source zero-days go usually unpatched longer. A bug of this nature would have been exploited for long before the fix (which may have happened anyway, mind).

4

u/[deleted] Apr 09 '14

Closed-source zero-days go usually unpatched longer.

I can understand why you might think so, but that's not necessarily true.

→ More replies (1)
→ More replies (1)

8

u/xiongchiamiov Apr 09 '14

Well, that's why pre-merge code review is so important.

8

u/muyuu Apr 09 '14

Apparently they do that, but they are understaffed and they get paid basically zero for that kind of work.

There's a lot to correct in terms of workload and incentives for some crucial OSS projects. Used by many but paid by almost nobody.

→ More replies (4)

72

u/WHY_U_SCURRED Apr 09 '14 edited Apr 09 '14

It raises the questions; who wrote it, who do they work for, and what were their motives?

Edit: English

136

u/dontera Apr 09 '14

This guy http://www.robin-seggelmann.de/ wrote it. His motivations were likely because he wrote his PhD thesis on streaming encryption and he thought he was clever. Also, he wrote the TLS Heartbeat RFC.

Here is the commit that brought us this, https://github.com/openssl/openssl/commit/4817504d069b4c5082161b02a22116ad75f822b1

33

u/Grimoire Apr 09 '14

16

u/thebigslide Apr 09 '14

Haven't we learned a thing or two recently about what can happen if you don't add braces to one line if blocks!? Especially with returns after them... I know it was hurried, but there's really no excuse for that.

4

u/[deleted] Apr 09 '14

I cringed while reading the code too. Put some darn braces on statements like that. Especially when you know tons of people are going to read your code.

→ More replies (1)

4

u/frtox Apr 10 '14

i cant stand gitub code review comments, they take over the screen. oh did you actually want to see what code was changed? no, no. you read comment now.

→ More replies (1)
→ More replies (2)

90

u/gvtgscsrclaj Apr 09 '14
  1. Some programmer.
  2. Some corporation.
  3. Laziness and tight deadlines.

I mean, I know the NSA crap that's been floating around makes that a legit possibility, but cases like this really feel like your normal level of sloppiness that's bound to happen in the real world. Nothing and no one is absolutely perfect.

12

u/zjm555 Apr 09 '14

Agreed. This is an Ockham's Razor scenario -- for every NSA backdoor, there are probably thousands of vulnerabilities that simply slip in by pure accident. Probability of such accidents goes up with the complicatedness of the solution, and with the number of lines of code.

41

u/paffle Apr 09 '14 edited Aug 17 '26

Almond cobblestone coherent society encouraging stocking spoon

This post was anonymized with Redact

80

u/cass1o Apr 09 '14

Then again, any respectable deliberate backdoor will have plausible deniability built in - in other words, will be disguised as mere everyday sloppiness.

I mean lack of evidence is just as good as evidence right.

7

u/paffle Apr 09 '14 edited Aug 17 '26

Acorn sort bow steep feather library thumb roof oxygen bake

This post was anonymized with Redact

→ More replies (5)

11

u/mallardtheduck Apr 09 '14

You gotta love conspiracy theories; "it looks like a mistake" - "plausible deniability, that's what they want you to think".

→ More replies (9)

24

u/emergent_properties Apr 09 '14 edited Apr 09 '14

And there is the International Obfuscated C Code Contest The Underhanded C Contest .. of which the goal is to make an app that has a sly code payload hidden in it that can be passed off as a mistake.

Plausible deniability is a thing, ESPECIALLY in this realm.

I am not saying that it was intentional or malicious, but you bet your ass with a security hole this big we shouldn't assume automatically innocence first..

EDIT: Corrected contest URL.

22

u/spook327 Apr 09 '14

I think you've confused two completely different things; the IOCCC is for making unreadable code. The one about programs that have a secret critical vulnerability is The Underhanded C Contest

4

u/emergent_properties Apr 09 '14

You are correct, I forgot which one did what.

Thanks, I corrected it.

9

u/gvtgscsrclaj Apr 09 '14

Alternatively, we can change the code review practices to ensure that the potential for both situations are vastly reduced in a practical manner, without needing to distract ourselves with casting blame about in all directions.

→ More replies (16)
→ More replies (1)
→ More replies (11)
→ More replies (6)