223 points · by EthanHeilman · 11y ago · 109 comments
Yeah, but many of the Rust features are present in the branch of Algol derived languages, namely Mesa, Modula-2, Modula-3, Oberon derivatives, Ada, Pascal dialects....
Yet it was required decades of security exploits for developers start grasping the major flaw it was to adopt C.
Can we please stop with the C bashing already? Each time there's a story about a buffer overflow, the top comment says how that would be impossible in Go, Rust, JavaScript or the next shiny thing.
First of all, hindsight is always perfect. I'm sure adopting C made sense at the time. We didn't use to stroll down the street with a supercomputer in our pockets you know.
And second, the constant stream of news about trivial SQL injections, cross-site scripting vulnerabilities and other such things should make it plenty obvious that you can write unsecure code in any language.
Except Algol, PL/I, PL/M and many others already existed and pre-dated the computers used to develop C on.
"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 at his 1980 ACM Turing Award Lecture
Algol was created in 1960 and run in computers much more humble that the PDP-11.
> And second, the constant stream of news about trivial SQL injections, cross-site scripting vulnerabilities and other such things should make it plenty obvious that you can write unsecure code in any language.
Those don't suffer from memory corruption issues. So there is a whole class of security exploits one doesn't need to worry about.
C gives you all those SQL injections, XSS, shellshock, etc. in addition to all memory unsafe exploits - it's a superset of vulnerabilities (actually, I'd not be surprised if C makes it worse, as the code is far, far more verbose and focused on minutia and hence higher-level logic failures are more difficult to notice.). And, going from widespread commercial software, the other issues seem to account for much less of the critical security bugs.
Even so, if they had some amazing backcompat reason to stick with C, they should have been sandboxing and otherwise limiting the impact of the apparently-inevitable, trivial memory corruption issues they're sure to have created.
The top comment made by the same person.
Find me an unintended trivial SQL injection or cross-site scripting vulnerability in Rust. Or Elm or Ur/Web, if you prefer more web-oriented languages.
All you have done is demonstrate that there are languages other than C that one should not write in, either. But of course there are. You have not demonstrated that all languages have these problems to the same extent.
It is rather like arguing that since you can get concussions in football, and you can also get concussions in ice hockey, it doesn't really matter what sport you play. While it is technically true that you can get concussions from golf or cross-country running, it takes quite a bit of skill and (un)luck to make it happen.
Suggesting that throwing thousands of lines worth of virtual machine behind a piece of code will solve security problems is shortsighted.
None of these have memory safety without GC (while supporting dynamic allocation and deallocation).
Mesa => RC with local GC for collecting cycles.
Modula-2 => True, does manually memory management, but avoids all other C memory corruption errors.
Modula-3 => Uses GC only for types allocated via NEW. Library contains generic RC pointers. Untraced pointers can only be used in unsafe code.
Oberon derivates => Uses GC only for types allocated via NEW. Active Oberon added support for untraced pointers only in unsafe code.
Ada => No GC. All memory allocation is controlled. Deallocation is only possible via regions or explicitly in unsafe code. There are generic RC libraries as well.
Pascal dialects => No GC. Suffer from manual memory management, but none of the other typical exploits regarding out of bounds or pointer misuse.
Yes, they may lack affine types, but had they succeed in the industry instead of C, the need of something like Rust would be greatly reduced.
As such now we have to place our hopes in something like Rust, because the new generations never heard of those languages and think C was the very first systems programming language.
However every time I look at Rust sample code I would like to see the same amount of _unsafe_ being used like in the those languages.
Instead, many Rust users seem to sprinkle it everywhere.
Some of those students tried their way into the recent workstation market using what they knew from their university. Sun was such case.
Back in those days we payed for development tools, so everyone used to stick with what the OS vendors had, why shell out money for another language that implied the extra effort of writing bindings.
So like the mobile and browser space nowadays, C as the UNIX language was the way to go.
Meanwhile, those university students and professional coders with access to UNIX at the university and work, wanted to be able to take work home.
So C dialects that where able to be used in the tiny home computers started to be developed and distributed over code listing in magazines, books and BBS.
When UNIX eventually took over the mainframes market, C got into the same spot like JavaScript in the browser.
The other languages, just like any systems programming language had their OSes, but they failed against UNIX. And as I mentioned before back then you needed a very good reason to convince someone to pay extra for compilers that weren't part of the OS SDK.
What more secure languages besides C are easy to call from C/C++ codebases? afaik ocaml isn't, at least in the sense that I don't think you can produce a c lib without sucking in the ocaml allocator and other stuff [1].
[1] http://www.mega-nerd.com/erikd/Blog/CodeHacking/Ocaml/callin...
If you're writing security code, put down the damn C.
(I mean, my personal opinion is just flat-out put down the damn C anyhow; even non-"security code" has a way of turning into security-sensitive code when you're not looking. But certainly if you're writing security code.)
Though Kapersky would have been better off even using C++/CLI and "It Just Works" to hook into code written in, say, C#. The IJW stuff is cute, as it seamlessly brings the CLR in-process and lets you transition from native to managed without noticing. (And MSVC's C++->CLI targeting is good enough to compile MS Office except producing MSIL instead of native code, fwiw.)
One of the big problems with C++ is that few people actually do this. It basically requires putting a linter into your build process, to check for C-isms and unsafe C++ behavior. Otherwise, people will use these things because they are easier.
My favorite thing about Rust is that it's carefully designed to make the safe things easier. It's much better if you need to go out of your way to do something dangerous than the outher way around.
Which is one reason, why although I like C++, I am happy to only use it in side project, and mostly settle with JVM/.NET stuff for work nowadays.
Most of the enterprise code bases I have seen on my career, are mostly C with Classes style and most companies don't use analyzers. I was quite happy when Clang introduction started to change the mentality in regard to analyzers.
Java had a basic arithmetic bug until what 2005? Bash shell had a serious bug until last year?
The people developing these software are all 10x smarter than you.
We have powerful computers these days. Software is eating the world. Let it eat the process of writing correct software, too.
"Many of the vulnerabilities described in this paper could have been severely limited by correct security design, employing modern isolation and exploit mitigation techniques. However, Sophos either disables or opts-out of most major mitigation technologies, even disabling them for other software on the host system."
"Unfortunately, analysis of ESET emulation reveals that is not the case and it can be trivially compromised. This report discusses the development of a remote root exploit for an ESET vulnerability and demonstrates how attackers could compromise ESET users."
So, yes, definitely.
I wonder if he has failed to exploit any of the antivirus that he tried or it was 3 for 3. What does it really mean, does using any antivirus at this point puts you at even more risk to targeted attack specially if you are a sensible user? What does that mean for corporate roll out of antivirus which I'm guessing would be the most likely candidate of such targeted attacks.
http://www.kaspersky.com/about/news/virus/2015/Duqu-is-back
Maybe someone was exploring the possibility that these vulnerabilities are features.
Just another conspiracy theory, of course...
Google's goals are so grand they see things like securing software and getting faster broadband everywhere as things worth doing. I've been reading their blog since launch and the team is very skilled, professional and interested in proving theory with actual exploits.
http://googleonlinesecurity.blogspot.de/2014/07/announcing-p...
The headline is kinda silly in the sense that if Project Zero focuses on any software in the world, they'll most likely find exploitable vulnerabilities. With Kaspersky the ridiculous thing is that they have stuff compiled without /GS, which e.g. since VS2005 has required you to actively disable it, as it's on by default.
http://www.bloomberg.com/news/articles/2015-03-19/cybersecur...
http://www.wired.com/2012/07/ff_kaspersky/
You'd be a little crazy to run this outside of Russia. I suspect there are more backdoors disguised as "vulnerabilities we knew nothing about, totally, its news to us!" This reads like a trivial overflow which would have been found with some basic testing. This is a common ploy with untrustworthy software.
Maybe Kaspersky was safe to run once, but with Russia's new brazen anti-West attitude, its a liability now.
I also thought it was odd he always seemed to have no problem catching US nation state malware, but all of those Russian state cyber weapons other companies keep finding seem to allude him and his team.
Coincidence?
Kaspersky blog has written up analyses of malware campaigns from many different countries. Here are some Russian-origin APT campaigns.
1. https://blog.kaspersky.com/turla-apt-exploiting-satellites/9...
2. https://securelist.com/blog/research/69731/the-cozyduke-apt/
3. http://www.kaspersky.com/about/news/virus/2014/crouching-yet...
Brian Krebs also writes about popular malware that first does a check to see if its being run on a computer in Russia. If so, it stops running. There's a lot of government sponsored malware coming from Russia. There's a public private partnership to put profitable malware on non-Russian computers and Russian officials turn a blind eye due to corruption, bribes, etc. Its all fairly ugly.
An average antivirus software has everything necessary already. Personal licenses as a way to identify the specific machine or person, automatic streaming software updates as a way to deliver the payload and almost unrestricted privileges on the target system enough to infiltrate and stay concealed.
As an example, there's still room for argument about the Dual_EC_DRBG algorithm, and RSA making that the default PRNG for some or all of their products. RSA denies taking money for it. Nobody can make an airtight case for the NSA deliberately weakening it. Yet we still all kind of view Dual_EC_DRBG with suspicion.
Not that RSA hasn't done so in the past, but it was public when encryption software could not be exported RSA cam to an agreement with the US government to export it's 64bit encryption, it would use a 40bit private key and append the message with an additional 24bits which are transmitted in clear text and complete the private key to it's 64bit size.
This was a government mandated "work reducer" so the NSA if need be could decrypt the message as they had the ability to break 40bit encryption and the rest of the 24 bit of the 64bit encryption key was known for each message. This wasn't hidden, this was even released in a conference with great pride that RSA could now export it's mail encryption suit to Europe. Germany made a fuss about this 5 years after the fact, but everyone pointed and said well they announced it in a conference.
If you're attacking Ormandy's character, I'd appreciate some proof over the usual conspirtard stuff that often gets upvoted uncritically on sites like reddit and HN. As far as I can tell, he is certainly one of the good guys and we are lucky to have him in such a high profile position at Google.
>Kaspersky released information about state-sponsored malware.
Kaspersky acutally is the dirtiest of the bunch with ties to Russian KGB/FSB. I suggest you rethink who your heroes are.
http://www.bloomberg.com/news/articles/2015-03-19/cybersecur...
Maybe Kaspersky was safe to run once, but that's just not true anymore.
A really cool dude.
How deep does the rabbit hole go?
Is it that hard to believe that there are certain people that would like to dissuade Kaspersky from revealing further information about state-sponsored malware? I'm not even sure where this incredulity is coming from? Let's see you target an intelligence agency and see what happens.
Kaspersky is no victim here. They've been so negligent in their own product's security that it is actively harmful to have it installed. That's literally the end of their product being useful for me and it applies to any other security company as well. I hope the rest of them get 'suggested' too, and soon! I'll be clear - this vulnerability is the one thing Kaspersky should have been spending their engineering resources on and they have failed utterly. Pack it up and close shop.
Thanks to Kaspersky for record breaking response times when handling this report, they’ve set a high bar to beat for other vendors!
I wonder how fast they were given the comment about 'high bar'.