zlacker

[parent] [thread] 20 comments
1. blowsk+(OP)[view] [source] 2021-07-20 20:59:32
I was with you until the parsing with memory unsafe languages. Isn’t that exactly the kind of “random security not based on a threat model” type comment you so rightly criticised in the first half of your comment?
replies(7): >>titzer+K1 >>ExtraE+h2 >>lisper+p2 >>kmeist+O5 >>static+Pa >>jvande+gn >>legule+dR2
2. titzer+K1[view] [source] 2021-07-20 21:07:59
>>blowsk+(OP)
Based on the hundreds, perhaps thousands of critical vulnerabilities that are due directly to parsing user input in memory-unsafe languages, usually resulting in remote code execution, how's this for a threat model: attacker can send crafted input that contains machine code that subsequently runs with the privileges of the process parsing the input. That's bad.
3. ExtraE+h2[view] [source] 2021-07-20 21:09:45
>>blowsk+(OP)
I mean, the threat model is that 1. Memory leaks/errors are bad 2. Programmers make those mistakes all the time 3. Using memory safe languages is cheap Therefore, 4. We should use memory safe languages more often
4. lisper+p2[view] [source] 2021-07-20 21:10:13
>>blowsk+(OP)
I think you must have misunderstood the point the parent comment was trying to make. Memory-safety issues are responsible for a majority of real-world vulnerabilities. They are probably the most prevalent extant threat in the entire software ecosystem.
replies(2): >>wahern+In >>IggleS+qu
5. kmeist+O5[view] [source] 2021-07-20 21:27:30
>>blowsk+(OP)
There are very few threat models that a memory unsafe parser does not break.

Even the "unskilled attacker trying other people's vulns" threat basically depends on the existence of memory-safety related vulnerabilities.

replies(1): >>blowsk+yb
6. static+Pa[view] [source] 2021-07-20 21:59:03
>>blowsk+(OP)
The attack surface is the parser. The ability to access it is arbitrary. I can't build a threat model beyond that for any specific case, but in the case of a text messaging app I absolutely expect "attacker can text you" to be in your threat model.
◧◩
7. blowsk+yb[view] [source] [discussion] 2021-07-20 22:05:02
>>kmeist+O5
Then we’re right back in the checklist mentality of “500 things secure apps never do”. I could talk to somebody else and they’d tell me the real threat to worry about is phishing or poor CI/CD or insecure passwords or whatever.
replies(1): >>static+Tc
◧◩◪
8. static+Tc[view] [source] [discussion] 2021-07-20 22:16:11
>>blowsk+yb
There is no "real threat". Definitely phishing is one of the top threats to an organization, left unmitigated. Thankfully, we now have unphishable 2FA, so you can mitigate it. When you choose to prioritize a threat is going to be a call you have to make as the owner of your company's security posture - maybe phishing is above memory safety for you, I can't say.

What I can say is that parsing untrusted data in C is very risky. I can't say it is more risky than phishing for you, or more risky than anything else. I lack the context to do so.

That said, a really easy solution might be to just not do that. Just like... don't parse untrusted input in C. If that's hard for you, so be it, again I lack context. But that's my general advice - don't do it.

replies(1): >>lansti+jg
◧◩◪◨
9. lansti+jg[view] [source] [discussion] 2021-07-20 22:46:09
>>static+Tc
In-arguable these days.
10. jvande+gn[view] [source] 2021-07-20 23:51:51
>>blowsk+(OP)
Add this language absolutism to the list of things we need to avoid.
◧◩
11. wahern+In[view] [source] [discussion] 2021-07-20 23:56:21
>>lisper+p2
Buffer overflows are common in CVEs because it's the kind of thing programmers are very familiar with. But I'm pretty sure that in terms of real-world exploits things like SQL injection, cross-site scripting, authentication logic bugs, etc, are still far more common. Almost all of those are in bespoke, proprietary software. A Facebook XSS exploit doesn't get a CVE.
replies(1): >>stevek+to
◧◩◪
12. stevek+to[view] [source] [discussion] 2021-07-21 00:05:14
>>wahern+In
First Microsoft, then two different teams at Google, and then Mozilla, and then someone else, all found that roughly 70% of security vulnerabilities reported in their products are due to memory unsafety issues. That roughly that number keeps coming up across all of the biggest companies in our industry lends it some weight.

Here's the first Microsoft one: https://www.zdnet.com/article/microsoft-70-percent-of-all-se...

And Chrome: https://www.zdnet.com/article/chrome-70-of-all-security-bugs...

replies(1): >>wahern+dr
◧◩◪◨
13. wahern+dr[view] [source] [discussion] 2021-07-21 00:32:56
>>stevek+to
Yes, I'm well aware of what the data says, as well as what the data is measuring--CVEs and bug reports in well-known C/C++/Java projects.

But not too long ago, before SaaS, social media, etc, displaced phpBB, WordPress, and other open source platforms, things like SQL injection reigned supreme even in the reported data. Back then CVEs more closely represented the state of deployed, forward-facing software. But now the bulk of this software is proprietary, bespoke, and opaque--literally and to vulnerability data collection and analysis.

How many of the large state-sponsored penetrations (i.e. the ones we're most likely to hear about) used buffer overflows? Some, like Stuxnet, but they're considered exceptionally complex; and even in Stuxnet buffer overflows were just one of several different classes of exploits chained together.

Bad attackers are usually pursuing sensitive, confidential data. Access to most data is protected by often poorly written logic in otherwise memory-safe languages.

replies(4): >>stevek+zx >>comex+ey >>kaba0+zk1 >>UncleM+hy1
◧◩
14. IggleS+qu[view] [source] [discussion] 2021-07-21 01:04:47
>>lisper+p2
It may sound like I’m being snarky, but I’m not:

Aren’t users / social engineering make up the actual majority of real-world vulnerabilities, and pose the most prevalent extant threat in the entire software ecosystem?

replies(2): >>lisper+dx >>static+NB
◧◩◪
15. lisper+dx[view] [source] [discussion] 2021-07-21 01:32:54
>>IggleS+qu
A fair point, but that's not really a problem with the technology. (And I did hedge with "probably" :-)
◧◩◪◨⬒
16. stevek+zx[view] [source] [discussion] 2021-07-21 01:36:34
>>wahern+dr
My understanding was that while some of these are about CVEs and such, not all are. Like my understanding was the Microsoft numbers are from across all products, proprietary and open source.
◧◩◪◨⬒
17. comex+ey[view] [source] [discussion] 2021-07-21 01:42:10
>>wahern+dr
> How many of the large state-sponsored penetrations (i.e. the ones we're most likely to hear about) used buffer overflows?

It really depends on the target. If you’re attacking a website, then sure, you’re more likely to find vulnerability classes like XSS that can exist in memory-safe code. When you’re talking about client-side exploits like the ones used by NSO Group, though, almost all of them use memory corruption vulnerabilities of some sort. (That doesn’t only include buffer overflows; use-after-free vulnerabilities seem to be the most common ones these days.)

◧◩◪
18. static+NB[view] [source] [discussion] 2021-07-21 02:12:54
>>IggleS+qu
Yes, but I think that within the context of discussing a memory safety vulnerability in a text messaging app it's reasonable to talk about memory safe parsers, no?

Beyond that, I've already addressed phishing at our company, it just didn't seem worth pointing out.

◧◩◪◨⬒
19. kaba0+zk1[view] [source] [discussion] 2021-07-21 10:16:05
>>wahern+dr
The thing is, SQL injection and cross-site scripting are both trivial to defend against — at least compared to memory safety. It has a small surface area and most frameworks do help with it, or at least it is in their realm of possibility.

Preventing buffer overruns require language-level support.

◧◩◪◨⬒
20. UncleM+hy1[view] [source] [discussion] 2021-07-21 12:10:44
>>wahern+dr
SQL Injection is a good lesson here. How is it mitigated effectively? By telling devs to write code carefully? No. It is mitigated by prepared statement libraries that are structurally resistant to SQL Injection. Similarly, "here are some static analysis tools - try your best to write safe C" is not a winning move.
21. legule+dR2[view] [source] 2021-07-21 18:38:34
>>blowsk+(OP)
The threat-model there is that the attacker controls the text that is parsed.
[go to top]