12 ms·
Microsoft: 70 percent of all security bugs are memory safety issues
- skyde 8y agowe should all be using Rust then :)
- ccnafr 8y agoI knew this comment was coming :)))
- mrinterweb 8y agoYeah. I looked at the comments looking specifically for this comment. I was not disappointing.
- grayrest 8y agoIt IS why Mozilla sponsored the language. The early "why Rust" presentations had a stat that (paraphrasing) 50% of Mozilla security bugs would have been prevented by the borrow checker.
- altmind 8y agoor some language with the runtime. for example, c#?
- icebraining 8y agoMicrosoft did just that, by extending C#: https://en.wikipedia.org/wiki/Singularity_(operating_system) https://en.wikipedia.org/wiki/Singularity_(operating_system)
- doggydogs94 8y agoMaybe you can do a proof of concept by writing a mini-Linux using Rust.
- raymond_goo 8y agohttps://www.redox-os.org/ https://www.redox-os.org/
- deleted 8y ago[deleted]
- mhandley 8y agoThis paper's an interesting read, about writing an OS in Go: The benefits and costs of writing a POSIX kernel in a high-level language https://www.usenix.org/conference/osdi18/presentation/cutler https://www.usenix.org/conference/osdi18/presentation/cutler
- reallydude 8y ago> Microsoft: 70 percent of OUR security bugs are memory safety issues Fixed the title. This is not an analysis about general software errors.
- TheForumTroll 8y agoBut seems to be a close match.
- pjmlp 8y agoLinux is much worse currently, hence the Kernel Self Preservation project being pushed by Google.
- throwupaway123 8y agoEvery project with millions of lines of C or C++ is going to be around the same, Firefox is over 50% as well.
- Thaxll 8y agoRight because Rust will prevent all the issues of Unsafe usage that an OS uses all the time ...
- bluejekyll 8y agoYou're being sarcastic, but I think you'll find the limited use of unsafe in Philipp Oppermann's series informative: https://os.phil-opp.com/ https://os.phil-opp.com/
- atoav 8y agoSay the same thing about seatbelts in a car. If you don’t plan to have accidents, why do you need seatbelts? Car accidents, like mistakes in programming are a risk that has a likelyhood that is non-zero. A seatbelt might be a little bit annoying when things go well, but much less so when they don’t. Rust is there to stop you in most cases when you try to accidentally shot yourself into the leg, unless you deliberately without knowing what you are doing while yelling “hold my beer” (unsafe). And contrary to popular belief even in unsafe blocks many of Rust’s safety guarantees hold, just not all If the net benefit of a ownership concept like Rust has it is high enough, this ahouls be an easy choice for rational actors to take. The odds are on Rust’s side here, because humans make mistakes and if Rust manages to allow productivity despite stopping certain classes of these mistakes, there will be a net benefit. Just like with the seatbelt, there will be always those that don’t wear one for their very subjective reasons (e.g. because of edge cases where a seatbelt could trap you in a burning car, or because it is not cool, or because they hate the feeling and think accidents only happen to people who can’t drive). I write Rust for a year now, and I constantly see bugs far better programmers made in say C++ where Rust just wouldn’t allow you to not handle it. E.g. Crashing your software by writing to a file that is locked by another process. In Rust this would mean the deliberate act of ignoring a Result, unwrapping it and moving on. You can ignore it, and Rust will crash, but you know exactly where you took that risk. Things like these remove a lot of cognitive load from the programmer which can be put into more pressing topics
- stochastic_monk 8y agoThere’s a similar distinction between most C++ development and dropping to low-level placement new, mallocs/frees, handwritten assembly or heavy use of intrinsics. You rarely need the latter, and, once wrapped, when used by the former is quite safe. The difference is that Rust was designed with this in mind. I like Rust; I’ve done some coding challenges in it. It won’t replace C++ for me for quite some time, but it’s about time there was a safe, powerful language that’s truly a worthy contender.
- Someone1234 8y agoJust a painful reminder that they scrapped Midori[0] their managed Operating System based on Microsoft Research's Singularity project[1]. Even if it only replaced Windows LTSB/Embedded, I'd still prefer an ATM, checkout, or gas station terminal I was using was running on managed code. Doubly so for the next generation of Nuclear Powered submarines[3]. Plus between virtualisation and silo-ed software management ("Apps") it seems entirely plausible to move the PC/Laptop to the next generation. [0] https://en.wikipedia.org/wiki/Midori_(operating_system) https://en.wikipedia.org/wiki/Midori_(operating_system) [1] https://en.wikipedia.org/wiki/Singularity_(operating_system) https://en.wikipedia.org/wiki/Singularity_(operating_system) [3] https://mspoweruser.com/uks-nuclear-submarines-runs-windows-xp-submarines/ https://mspoweruser.com/uks-nuclear-submarines-runs-windows-...
- theamk 8y agoI'd strongly prefer that my ATM had no start menu, file picker, online help system, interactive parts of update system, or any of the thousands of other UI apps which could be exploited via touchscreen if accidentally activated. Singlularity would be cool, but I'd prefer smaller footprint to begin with.
- derefr 8y agoMicrosoft already have what you're talking about; it's called Windows IoT Core. (This is in contrast to Windows IoT Enterprise, which is the more traditional "Windows Embedded" experience with many of the features you're complaining about. This is mostly because Enterprise customers want to be able to slap their coded-for-a-desktop apps onto a kiosk and declare the job done.)
- maxxxxx 8y agoI have never heard about IoT Core before, only IoT enterprise and LTSC. This would actually have been an interesting choice for the project I am working on right now. It's really infuriating how many versions MS is cranking out without clear differentiation between them and even when you talk to MS reps they know nothing about the options.
- zozbot123 8y agoTL;DR: The Rust Evangelism Strike Force and the Rewrite-it-in-Rust Task Force have a lot of work to do.
- mrinterweb 8y agoRemember, and I think it goes without saying, any rust rewrite of any scope of project is always trivial, and should be talked about as if a full rewrite naturally will be trivial. Proceed.
- monocasa 8y agoThere's a lot of memory safe languages out there that are great choices. Coming from a Microsoft statement, .Net is pretty neat. When your worst case latency/perf requirements don't allow you to have a GC, Rust is another great choice.
- Waterluvian 8y agoWhat exactly is .Net in this context? Every time I think I understand it someone throws a curve ball. Is it c#? Is it a set of libraries?
- ComputerGuru 8y agoIt’s the CLR (common language runtime) running in a JIT environment.
- kccqzy 8y ago> Terms like buffer overflow, race condition, page fault, null pointer, stack exhaustion, heap exhaustion/corruption, use after free, or double free --all describe memory safety vulnerabilities. Page faults are fine. Null pointers are fine; just don't dereference them. Race condition is a much more general term that can cover non-memory races too; perhaps they meant data races.
- ComputerGuru 8y agoYes, I don’t think race conditions should feature in a list of memory safety issues. However page faults can be not fine - on some hardware it can be a hard fault.
- sempron64 8y agoTo quote the article: ``` Furthermore, as Microsoft has patched most of the basic memory safety bugs, attackers and bug hunters have also stepped up their game, moving from basic memory errors that spew code into adjacent memory to more complex exploits that run code at desired memory addresses, ideal for targeting others apps and processes running on the system. ``` Is all we can hope for in the security game a series of mitigations? As soon as we add layers of security (Stack cookies, ASLR, memory "safe" languages with exploitable runtimes, etc.) it seems like new methods are invented to bypass them and those methods gradually become widespread (ROP chains, runtime fuzzing, rowhammer, speculative execution exploits). What is the next "70 percent" of security bugs? Is there an end to this race? I think the only thing in the future that can ever be as secure as in-person conversation and paper records is devices using zero-intermediary communication, in the style of an ansible https://en.wikipedia.org/wiki/Ansible https://en.wikipedia.org/wiki/Ansible, and extremely restricted storage which can only store data and not arbitrary application state.
- ip26 8y agoSecurity is an arms race, in a quite literal sense of the term. Arms races don't really ever end, except for truces/treaties or total victory.
- raymond_goo 8y agoNo, just use Rust...
- swsieber 8y agoWell, that wouldn't eliminate everything (row-hammer, speculative execution), but it would probably get rid of the most common culprits - buffer overflows and use after free.
- phkahler 8y agoThings like row hammer will not get attention until they are commonly used. Rust does eliminate the most common vulnerabilities and should be seriously considered for any new project that would otherwise be written in C.
- doggydogs94 8y agoLinux is also written in C.
- 21 8y agoAnd it has MORE reported CVEs than Windows:https://www.cvedetails.com/top-50-products.php?year=2018 https://www.cvedetails.com/top-50-products.php?year=2018
- CryoLogic 8y agoIt's also OSS and it is much easier to surface security bugs for Linux than for Windows. In my own research, I have attempted to send Microsoft security bugs only to be told they would be backlogged and reviewed later (which never happened to my knowledge).
- 21 8y ago> It's also OSS and it is much easier to surface security bugs for Linux than for Windows. Shouldn't then the number of bugs decrease much faster, since they are easier to find? Unless they are introduced at even a greater rate than the ones in Windows.
- Dahoon 8y agoNo, because linux OS's includes a lot of software in their repositories and new packages are added all the time. Look closer at the list. "40 Debian CVEs in 2019" breaks down to this: * Google Chrome: 36 * Artifex Ghostscript: 1 * ZeroMQ: 1 * macOS CUPS: 2 * Debian: 0
- sanxiyn 8y agoYou are right. One current estimate is that Linux is introducing security bugs at a rate faster than they are fixed.
- Dahoon 8y ago
- myth17 8y agoWhere can I find the original presentation from Microsoft's engineer?
- est31 8y agohttps://twitter.com/epakskape/status/1093488162318491648 https://twitter.com/epakskape/status/1093488162318491648 https://github.com/Microsoft/MSRC-Security-Research/blob/master/presentations/2019_02_BlueHatIL/2019_01%20-%20BlueHatIL%20-%20Trends%2C%20challenge%2C%20and%20shifts%20in%20software%20vulnerability%20mitigation.pdf https://github.com/Microsoft/MSRC-Security-Research/blob/mas...
- donatj 8y ago29% SQL Injection?
- dtrailin 8y agoLink to the presentation this article is based one but doesn't site for some reason: https://github.com/Microsoft/MSRC-Security-Research/raw/master/presentations/2019_02_BlueHatIL/2019_01%20-%20BlueHatIL%20-%20Trends%2C%20challenge%2C%20and%20shifts%20in%20software%20vulnerability%20mitigation.pdf https://github.com/Microsoft/MSRC-Security-Research/raw/mast...
- HugoDaniel 8y agoIn 2015 they become the first gold contributor to OpenBSD https://www.zdnet.com/article/microsoft-becomes-openbsds-first-gold-contributor/ https://www.zdnet.com/article/microsoft-becomes-openbsds-fir...
- Animats 8y agoThis late? With Microsoft's move to C# and the Static Driver Verifier? The latter pretty much fixed this for drivers, which used to be the biggest source of kernel crashes. I thought Microsoft was past this.
- pjmlp 8y agoThere is still a strong C and C++ community at Microsoft. They are the only OS vendor (on consumer space) still having a full stack support for C++, with internal pushes to keep it going. https://kennykerr.ca/2019/01/25/the-state-of-cpp-on-windows/ https://kennykerr.ca/2019/01/25/the-state-of-cpp-on-windows/
- fouc 8y agoFirst 38% of bugs at Airbnb could have been prevented by using type safety. Now 70% of all security bugs at Microsoft could have been prevented by using memory safety.
- spricket 8y agoExactly, this explains why my Java code is 108% bug free
- deleted 8y ago[deleted]
- ilovecaching 8y agoRust couldn't solve all of these bugs, but it certainly would have drastically reduced the total amount. The code would also be drastically easier to write and debug. C++17 is still a total mess to write, despite what Microsoft might tell you in their docs. Really doesn't make sense to me, outside of the sunk cost fallacy, why Microsoft isn't pivoting to Rust if they want to write C++.
- sumitgt 8y agoMicrosoft probably has tons of internal libraries that are modified and shared between many different teams spanning multiple orgs. I think a pivot like this is an incredibly complicated thing for a company like Microsoft to perform. It requires multiple years of planning from the ground up to port internal libraries and tooling, train engineers on Rust best practices. Not to mention the tricky business of going around and hiring Rust developers at the scale MS needs. :) I think, simply waking up one day and changing the language / frameworks / tools used by your company is a privilege only smaller companies and startups might enjoy.
- ilovecaching 8y agoI would imagine that we would at least hear about Microsoft doing some new projects in Rust, or at least using it in some capacity to understand the cost/benefits better. I'm sure the first step would be increasing C++ interop.
- sanxiyn 8y ago> I would imagine that we would at least hear about Microsoft doing some new projects in Rust We did.
- duneroadrunner 8y agoReplacing existing unsafe C++ elements with compatible memory safe substitutes[1] might be more expedient. The conversion can even be automated[2] for parts of the code that aren't performance critical. [1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus https://github.com/duneroadrunner/SaferCPlusPlus [2] https://github.com/duneroadrunner/SaferCPlusPlus-AutoTranslation https://github.com/duneroadrunner/SaferCPlusPlus-AutoTransla...
- max76 8y agoAs an industry we should deprecate all unmanaged code. We've proven time and time again that even very professional and highly scrutinized unmanaged code can have critical data safety faults. Yes, I understand this includes Linux, Windows, BSD, Darwin (iOS, MacOS, watchOS, etc), The Android Runtime, and lots of critical software that runs on top of those systems. We have the tools to write very efficient managed code. Critical security flaws involving unauthorized access to data will continue to appear until we make the transition. The cost of these security flaws is likely to become more expensive than the cost of replacing the existing software. To make matters worse we are continuing to write more unmanaged code everyday.
- jodrellblank 8y agoThe cost of these security flaws is likely to become more expensive than the cost of replacing the existing software. Expensive to whom? When was Microsoft or RedHat or Oracle or the FreeBSD foundation last fined or sued because of a security flaw - an unmanaged memory one, specifically? When was a random company or developer fined or sued for same?
- asdff 8y agoShutting down servers or stealing credit card info certainly has a cost
- max76 8y agoThe bandwidth costs for Globalsign incurred for revoking SSL certificates in response to Heartbleed was estimated to $400K in a Cloudflare blob post [0] and eWeek estimated the total cost of Heartbleed to be $500M [1], although admittedly this price tag is an educated guess. You're question is expensive to whom. The answer is the expenses are spread across the entire industry. Every time a software author needs to write a patch the bigger cumulative expense is to all of their customers that need to apply the patch. [0] https://blog.cloudflare.com/the-hard-costs-of-heartbleed/ https://blog.cloudflare.com/the-hard-costs-of-heartbleed/ [1] https://www.eweek.com/security/heartbleed-ssl-flaw-s-true-cost-will-take-time-to-tally https://www.eweek.com/security/heartbleed-ssl-flaw-s-true-co...
- 8y ago
- davidjnelson 8y agoFuzz testing is a useful tool for finding these types of bugs. See https://en.m.wikipedia.org/wiki/Fuzzing https://en.m.wikipedia.org/wiki/Fuzzing
- DenisM 8y agoIt's a pity Modula-2 did not gain wider adoption 30 years ago - it has almost all the memory safety of managed languages and none of the performance penalties. Array bounds were checked by compiler and the only available unsafe operation was deallocate, all other unsafe operations were sequestered into separate module which could be easily isolated, audited, and/or banned as appropriate. Life could have been so much better.
- arcticbull 8y agoLuckily now we have Rust! :)
- DenisM 8y ago30 years of pain tho? Plus however many more years it will take to phase out existing C-based code, so another 30 at least.
- arcticbull 8y agoI think Ada was type-safe too, agreed re: 30 misspent years, and here's hoping it doesn't take 30 more to get where we need to be.
- phkahler 8y agoLook to the future and try to build it on the lessons of the past. Dont worry about the missed opportunities, if anyone knew in advance C and C++ would not have been used the way they were.
- lewisinc 8y agoIt depends how it gets prioritized by the companies that own and contribute to these codebases - both open and private source. Right now there's not much incentive financially to migrate away from any of the existing code, so more often than not it will not happen. One reason why we're seeing stuff like the [FirecrackerVM](https://firecracker-microvm.github.io https://firecracker-microvm.github.io) or [AzureIoTEdge](https://github.com/Azure/iotedge https://github.com/Azure/iotedge) is that the companies behind them know they will attract privacy-/security-minded customers they might not otherwise have. There's other reasons as well, but this is just what stands out to me first.
- spricket 8y agoI hope Rust comes of age in a few years. Java, Go, and C# are above 50% "native" speed in every benchmark I've run across, but the mantra continues to be "why would I pick something slower?". Rust is the answer everyone wants, even if they don't really need it. An aside, C# in .NET core is getting very close to native speed. It's passed Java in many benchmarks, mostly due to type reification and lack of boxed primitives. Java is trying to catch up, with active research projects for copying C#'s native types, a "Java on Java JIT" (Graal). And most interesting to me, fiber based green threads. If these projects bear fruit, we may be only a few years away from Java exceeding native code speed in most applications
- drainyard 8y agoUnity's work on HPC# (High Performance C#) seems like a good possibility of a middle ground: Use C# where performance is not critical but you want safety, use HPC# when you absolutely need restrictions on performance.
- pjmlp 8y agoI hardly use C++ since 2006, only when I am forced to step outside Java/.NET or happen to actually do some hobby projects in C++. Meanwhile at work, a couple of C++ servers have been replaced by managed ones across a couple of projects. Even with the current stacks, not every business needs the ultimate performance across all stack, as an example Siemens and Zeiss use .NET on their digital imagining solutions, with native code only in the hotspots.
- deleted 8y ago[deleted]
- hk-mars 8y ago90% of these memory bugs of MS are related to C++, bad designers I think; C is still good in low level of system hack.