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

Show parent comment

-9

u/drguildo Apr 09 '14

C is an extremely versatile and powerful language

No, it isn't. C is an extremely basic (it's referred to as high-level assembler for a reason) and potentially dangerous language and the vast majority of programming problems it's used for would be much better served by a language that is performant enough to tackle them but without the security problems.

Also if you read the content in the link you'll realise that this wasn't caused by a design feature in the C language

It kind of was, and anyway I was referring to both that and the original bug (and all the other myriad bugs caused by "features" of the C language)

The (1) TLS and (2) DTLS implementations in OpenSSL 1.0.1 before 1.0.1g do not properly handle Heartbeat Extension packets, which allows remote attackers to obtain sensitive information from process memory via crafted packets that trigger a buffer over-read

Being able to read past the end of an array is a design "feature" of the C language.

The regular C library would mitigate both those issues.

The problems (the original bug and the malloc fuck-up) shouldn't need to be mitigated.

11

u/partyboy690 Apr 09 '14

Yes C is very basic but to say it's not powerful is absolutely ludicrous, reddit is hosted on web servers that are running an operating system written in C, more than likely the web server is heavily C based(if it's Apache or Nginx) and the computer you're using to read this thread is running an operating system written in C also more than likely your browser if it's Gecko or Webkit based is heavily C and C++ oriented. There's a difference between power and being basic. You have to write twenty lines of code in C what you could do in one on Python but Python wouldn't exist only for its runtime written in C.

Also it is very versatile specifically because it's as you say high level assembler, embedded systems are all heavily C based and lots of these things make your life easier. Don't get me wrong, C is a very unsafe language I know, I've fixed a myriad of bugs myself that wouldn't exist in Java, Python etc.... but basic programming practices and well tested code and you should be fine. If the OpenSSL guys didn't use their own allocation routine then there wouldn't be this mess, leave that to the maintainers of standard libraries, they're incredibly well vetted and used every single second by thousands and thousands of programs worldwide, those guys wouldn't write their own encryption library so the OpenSSL team shouldn't "enhance" the standard C library. This is a fault of the OpenSSL team and not the C language.

I'm not criticising your opinion btw, C can cause dangerous bugs but we can't all get on the C and C++ hate train when this bug is easily mitigated, there are operating system checks that can easily mitigate such a scenario.