News for hackers. Stuff that matters.
Re:OpenSSL Security Advisory by nine_k on Thursday September 22, 2016 @09:36AM (#12556695)
Exactly. With C, it will effectively never end. Libraries like that would probably benefit most from using a language with strict static analysis, like Rust. Tools Of similar nature for C do exist, but probably they are harder to apply, and likely not free.
Re:OpenSSL Security Advisory by fredmorcos on Thursday September 22, 2016 @10:29AM (#12556999)
I hope I don't come across too harsh.

Is HN still really up for that argument? Yes, we know the downsides of C. But the upside is that _we know the downsides of C_.

Constantly complaining about C isn't going to get anyone anywhere. It's been shown over and over again that secure C coding is possible and doable and feasible and exists in the real world. Some of the most secure software is written in C, and that's not attributed to enough fingers banging at a keyboard over a C program, but because C forces the programmer that _wants_ to write a secure program think about all the issues, the universe and everything.

So please, pave the road and show us the safer OpenSSL-rust you have. Until then good luck and thank you for your feedback.

Re:OpenSSL Security Advisory by ctz on Thursday September 22, 2016 @02:01PM (#12558758)
I've spent a career of 12 years writing, reviewing and breaking C in high-security products such as HSMs. I'm still to see real world, secure C. Maybe you could point me towards the numerous real world examples of people getting this right. I'd prefer scaled-up outcomes here, not just saying 'djb wrote qmail'.

(Incidentally, I don't have a quarrel with C specifically. All memory-unsafe languages expand the range of terrible vulnerabilities available to the engineer. This is not defensible these days, in my view.)

> So please, pave the road and show us the safer OpenSSL-rust you have.

My contribution here is https://github.com/ctz/rustls

Re:OpenSSL Security Advisory by astrodust on Thursday September 22, 2016 @06:09PM (#12560749)
DJB wrote Qmail, then abandoned it like an unwanted child. He might be a good programmer, but he's a really bad maintainer.

OpenSSL was all but abandoned as well. At least now there's a lot of attention being focused on making it better and more maintainable.

There's numerous tire fires out there: ImageMagick, OpenSSL, some Linux kernel drivers, and other projects people just take for granted without pitching in to help fix things.

Re-writing in Rust is a form of helping, and maybe in the process we'll find bugs in the originals or wholesale replace them with something better.

Re:OpenSSL Security Advisory by andrewchambers on Thursday September 22, 2016 @08:21PM (#12561444)
I think OpenBSD beg to differ.

Not to mention I would argue memory exhaustion bugs like this happen in memory safe garbage collected languages frequently too.

Re:OpenSSL Security Advisory by lambdasquirrel on Thursday September 22, 2016 @08:44PM (#12561530)
There are edge cases for everything. A language is what it makes easy.
Re:OpenSSL Security Advisory by captn3m0 on Thursday September 22, 2016 @03:06PM (#12559335)
Off-topic, but a quick question on your project:

> Kerberos

>broken, obsolete, badly designed, underspecified, dangerous and/or insane

Which list does Kerberos fit in?

Re:OpenSSL Security Advisory by ctz on Thursday September 22, 2016 @03:35PM (#12559622)
There are no standard kerberos ciphersuites that use anything better than RC4/IDEA/DES/3DES: http://www.iana.org/assignments/tls-parameters/tls-parameter.... So: broken and obsolete.
Re:OpenSSL Security Advisory by emmelaich on Thursday September 22, 2016 @07:51PM (#12561324)
Recent Windows, Linux and Java Kerberos all standardise on AES* and the ones you list are deprecated and for some have to be explicitly enabled.

So .. progress is being made.

Re:OpenSSL Security Advisory by seanwilson on Thursday September 22, 2016 @11:09AM (#12557326)
> It's been shown over and over again that secure C coding is possible and doable and feasible and exists in the real world. Some of the most secure software is written in C, and that's not attributed to enough fingers banging at a keyboard over a C program, but because C forces the programmer that _wants_ to write a secure program think about all the issues, the universe and everything.

This reasoning doesn't make sense. Use a language that makes a bunch of security flaws impossible (barring OS and compiler bugs anyway) so that you can concentrate properly on the possible security flaws left. Why deliberately make life hard for yourself if there are other language choices (assuming there are other choices to C in what you're doing)?

Even the best developers make mistakes. When you're picking your stack for security sensitive work you should be picking the stack that minimises the chance of mistakes and the impact of those mistakes. C is at high risk of making mistakes and those mistakes have a high chance of being exploitable.

Re:OpenSSL Security Advisory by banachtarski on Thursday September 22, 2016 @03:59PM (#12559834)
> Use a language that makes a bunch of security flaws impossible

The implicit assumption here is that the language isn't at the same time introducing a number of other vulnerabilities. Is there a language you would like to suggest?

Re:OpenSSL Security Advisory by seanwilson on Friday September 23, 2016 @08:25AM (#12564013)
I'd wager the vast, vast majority of Java, Python and OCaml projects would have significantly less security exploits compared to an equivalent C project. Simply making buffer overflows impossible (as much as they can be) takes a huge burden away from you.
Re:OpenSSL Security Advisory by chrismonsanto on Thursday September 22, 2016 @07:44PM (#12561281)
"Actually, more static analysis makes things less secure"

That is a preposterous argument.

Re:OpenSSL Security Advisory by autognosis on Friday September 23, 2016 @02:50AM (#12562794)
I agree. But who are you talking to? I didn't see that argument made.
Re:OpenSSL Security Advisory by banachtarski on Tuesday September 27, 2016 @05:59PM (#12593590)
Come again?
Re:OpenSSL Security Advisory by jerf on Thursday September 22, 2016 @10:57AM (#12557221)
It's not Rust, but: https://golang.org/pkg/crypto/tls/

I know it says "partial" implementation, but it's quite good even so, and has had everything I need. It doesn't do SSLv2, but nowadays that's more virtue than vice.

Erlang has an independent SSL implementation as well; it binds to OpenSSL but as I understand it just uses the heavy-duty math parts, not the protocol parts, which are instead written in Erlang.

Non-C SSL implementations in memory-safe languages exist.

Note that "but are they as well road-tested" or similar such things would be moving the goal posts. Not necessarily wrong or bad objections, but different objections. Probably nothing, not even the other C implementations, is as well "road tested" as OpenSSL, but, then again, OpenSSL hasn't exactly passed that road testing with flying colors now, has it?

Re:OpenSSL Security Advisory by fredmorcos on Thursday September 22, 2016 @11:11AM (#12557340)
(Just my opinion)

I completely agree with everything you point out. The argument I am bringing up is not about implementation, it's about "if they didn't use C, they would have less (security) problems": No.

C is the way it is towards secure coding because there are compromises to satisfy other dimensions. <Fancy new language that promises to solve all of C's problems> is either making huge sacrifices in these other dimensions or is at best an experiment.

We understand C's weak points so well (due to being widespread, battle tested, really simple, or what have you), that most of the time it's safer (read: more secure) to tread dangerous well-understood territories carefully than uncharted ones only promising to be safe.

Re:OpenSSL Security Advisory by amenod on Thursday September 22, 2016 @12:04PM (#12557804)
I would agree with you if it wasn't for Rust. If you don't know it yet, I would advise you read up about it - it is ideal for replacing C, being equal at speed and better at safety from common programming errors.
Re:OpenSSL Security Advisory by willtim on Thursday September 22, 2016 @12:34PM (#12558033)
There are others too, e.g. ATS
Re:OpenSSL Security Advisory by omginternets on Thursday September 22, 2016 @11:23AM (#12557453)
What are the sacrifices being made by, say, Rust?

I'm only superficially familiar with Rust, but my understanding was that it was basically "C with strong memory guarantees". I naively thought that its entire purpose was to avoid such trade-offs.

Re:OpenSSL Security Advisory by vvanders on Thursday September 22, 2016 @01:54PM (#12558698)
Certain things(circular structures) are harder to represent without dropping down to unsafe code(which is a C equivalent security model).

It's a bit more upfront work to satisfy the compiler but I've found the payoff in debugging memory issues to be completely worth it.

Re:OpenSSL Security Advisory by omginternets on Thursday September 22, 2016 @02:07PM (#12558807)
Right, so then it is a net advantage over C, with the (negligible) trade-off of compiler-wrangling. The parent comment seemed to suggest the contrary.
Re:OpenSSL Security Advisory by bluejekyll on Thursday September 22, 2016 @11:33AM (#12557559)
> It's not Rust, but: golang

This is a false choice. Go and Rust are not replacements for each other. They both have qualities which make each better suited for different environments.

Rust is actually capable of replacing all uses of C, Go's runtime will generally be an impediment to using it in certain cases.

Also I would argue that there are entire classes of bugs that are still available in Go that are not in Rust, that make it less suited for security. Null pointer exceptions, and unchecked errors are the two that come to mind.

Re:OpenSSL Security Advisory by brinker on Thursday September 22, 2016 @02:40PM (#12559085)
I don't think they were offering up Go as an alternative to C, but rather giving an example of an OpenSSL implementation in a language that isn't C. Rust is mentioned because the prior comment called for the creation of a pure-Rust OpenSSL library as proof that Rust can be used in this context. No such things exists, but they were trying to offer up a similar example to prove the same point.
Re:OpenSSL Security Advisory by kelnos on Thursday September 22, 2016 @01:34PM (#12558558)
I don't know if this has changed, but at one point the author of crypto/tls basically said "this hasn't been audited or carefully looked at; do not use this code". Not exactly a ringing endorsement, even if he's stopped saying that.
Re:OpenSSL Security Advisory by astrodust on Thursday September 22, 2016 @06:08PM (#12560742)
It's easy to interpret these arguments as "C sucks, let's use Rust" instead of "C is a very mature language with enormously complicated code-bases in play running mission critical software which is not trivially replaced by something like Rust but which could stand to benefit from building things into the compiler to check for mistakes like the Rust compiler does."

Compiling C code is easy, but auditing C code is hard. Getting Rust code to compile without getting berated about every little thing is hard, but at least you're confident then you've got everything right.

Re:OpenSSL Security Advisory by lawnchair_larry on Thursday September 22, 2016 @12:25PM (#12557965)
I think the the opposite has been shown. It's not really a complaint, it's a reflection on the facts. C is my favorite language, and a spade is a spade.
Re:OpenSSL Security Advisory by caf on Thursday September 22, 2016 @11:11AM (#12557341)
Is the "Severity: High" issue here the kind of thing that would be caught by Rust's static analysis, though? The bug isn't a case where the language rules are broken, but rather a failure to set a reasonable limit on the resource consumption that a client can cause.
Re:OpenSSL Security Advisory by josefx on Thursday September 22, 2016 @07:25PM (#12561176)
> Libraries like that would probably benefit most from using a language with strict static analysis, like Rust.

Wont help when developers then go out of their way to write a large amount of unsafe code. OpenSSL went out of its way to reimplement the C standard library wrong, making it impossible to use with analysis tools like valgrind or a checked malloc and generally confusing developers. iirc it even used malloc(pop)/ free(push) as a stack to pass data around at some point.

Re:OpenSSL Security Advisory by ninja-wannabe-7 on Friday September 23, 2016 @02:51AM (#12562798)
It's too easy to just blame C, it's their slap-dash, design-by-committee kitchen-sink features, lack of process, absense of rigor and generally amateurish "engineering," if it can be called that, of a now critical security framework. Why isn't every release first run through valgrind tools and some commercial C bug-finding tools used by embedded / safety-critical systems and why aren't there proofs of it's correctness? They have and/or could get the money/resources.
Re:OpenSSL Security Advisory by bjourne on Thursday September 22, 2016 @10:10AM (#12556896)
It won't end with Rust either since it is so appealing and easy to jump into unsafe territory.
Re:OpenSSL Security Advisory by danarmak on Thursday September 22, 2016 @10:24AM (#12556973)
Easy is not the same as necessary. At least high-security projects like OpenSSL could enforce a policy of not using unsafe code, and it's easy to validate that there's no unsafe code or that the few known instances are very well vetted.
Re:OpenSSL Security Advisory by bjourne on Thursday September 22, 2016 @12:00PM (#12557779)
You could do the same with C code -- it is getting everyone to follow the policies that is the hard part. Even compiling Rust code in release mode instead of debug removes some essential safety features. Should be clear by now that "policies" just doesn't work, but no, project are repeating the exact same mistake over and over again. :)
Re:OpenSSL Security Advisory by danarmak on Thursday September 22, 2016 @12:49PM (#12558162)
The crucial difference is between a policy, which people can not follow (and you might not catch them), and a language or compiler restriction, which people can't work around without doing something drastic like shelling out to a new process, which you can catch (in a well built language).
[dead]
Re:OpenSSL Security Advisory by danarmak on Thursday September 22, 2016 @04:56PM (#12560306)
Is the beauty you see in C inseparable from its unsafety? Are the unsafe parts that other languages don't have the most beautiful ones?

There's a big difference between arguing for safety and arguing for Rust specifically. Everyone likes some languages and dislikes others. Can you design a safe(r) language that you would consider to be beautiful?

Re:OpenSSL Security Advisory by steveklabnik on Thursday September 22, 2016 @08:11PM (#12561403)
What essential safety features are removed? The only thing I can think of this referring to is assertions, and we do the opposite: assert stays in all builds, debug_assert is only in debug builds.
Re:OpenSSL Security Advisory by bjourne on Thursday September 22, 2016 @08:17PM (#12561425)
Integer overflow checking, for example.
Re:OpenSSL Security Advisory by wbl on Thursday September 22, 2016 @08:41PM (#12561521)
Integer overflow cannot result in memory safety violations in Rust.
Re:OpenSSL Security Advisory by ben_bai on Friday September 23, 2016 @06:54AM (#12563613)
But it can overflow, which will result in a different value that the programmer might expect, which can give an attacker a nice "information leak" or worse. This could be a security bug!
Re:OpenSSL Security Advisory by gajjanag on Friday September 23, 2016 @08:54AM (#12564168)
Exactly. Memory safety is a very nice property, but is not complete by itself. This primary emphasis on memory safety was part of a critique of Rust by Andrei Alexandrescu: https://www.quora.com/Which-language-has-the-brightest-futur....

And even wrt memory, Rust (with the standard library) is not free of its own warts, see the OOM situation. See e.g https://news.ycombinator.com/item?id=10545877 for a discussion on this.

Just to be clear: I generally like the ideas of Rust. I just dislike its presentation by some as a magic solution to all kinds of concerns.

[dead]
Re:OpenSSL Security Advisory by sctb on Thursday September 22, 2016 @06:35PM (#12560898)
Since this account seems to have been created solely to violate the guidelines with, we've banned it. We're happy to unban accounts if you email [email protected] and we believe you'll post only civilly and substantively in the future.
Re:OpenSSL Security Advisory by mbrock on Thursday September 22, 2016 @10:14AM (#12556917)
This kind of resource DoS attack doesn't seem like it's directly related to safe/unsafe. I think you would be just as likely to forget to put a resource limit if you were writing in Haskell.
Re:OpenSSL Security Advisory by Manishearth on Thursday September 22, 2016 @11:13AM (#12557349)
> so appealing and easy to jump into unsafe territory.

I've almost never seen unnecessary unsafe code being used in Rust. I've seen it very few times for performance, but it's carefully done.