11 ms·
Classic thread on this stuff from Halvar Flake: https://twitter.com/halvarflake/status/1156815950873804800 https://twitter.com/halvarflake/status/1156815950873
by tptacek 3y ago
Classic thread on this stuff from Halvar Flake:
https://twitter.com/halvarflake/status/1156815950873804800 https://twitter.com/halvarflake/status/1156815950873804800
With that in mind, it'd be handy to know which exploit techniques these steps break, and whether those steps are in the current "meta" game for exploit developers.
(The specific mitigation here: the kernel formerly locked system call invocation down to the libc.so area of program text in memory; libc.so is big, so now OpenBSD locks specific system calls down to their specified libc stubs; further, in static binaries, the same mechanism locks programs down to only those system calls used in the binary, which effectively disables all the system calls not explicitly invoked by the program text of a static binary).
- harry8 3y agohttps://nitter.net/halvarflake/status/1156815950873804800 https://nitter.net/halvarflake/status/1156815950873804800 for those who don't have an X a/c
- vngzs 3y agoIndeed, in CCC's "systematic evaluation of OpenBSD's mitigations"[0] the presenter explicitly calls out OpenBSD's tendency to present mitigations without specific examples of CVEs it defeats or exploit techniques the mitigations are known to defend against: > Proper mitigations I think stem from proper design and threat modeling. Strong, reality-based statements like "this kills these vulnerabilities," or "this kills this CVE; it delays production of an exploit by one week." And also thorough testing by seasoned exploit writers. Anything else is relying on pure luck, superstition, and wishful thinking. Some of OpenBSD's mitigations are excellent and robust in defensiveness; others are amorphous and not particularly useful. [0]: https://youtu.be/3E9ga-CylWQ?feature=shared&t=2770 https://youtu.be/3E9ga-CylWQ?feature=shared&t=2770
- zamalek 3y agoThere have been cases where OpenBSD's hypothetical mitigations have worked out well for the project. I recall a relatively recent DNS cache poisoning attack that OpenBSD was novel in pre-emptively mitigating because something (I think it was the port?) was "needlessly" random. If a mitigation has negligible performance impact, and doesn't introduce a new attack vector, I can't imagine why it would be seen as a bad thing.
- lmm 3y ago> If a mitigation has negligible performance impact, and doesn't introduce a new attack vector, I can't imagine why it would be seen as a bad thing. Because it creates confusion about your threat model, which can ultimately weaken your security.
- insanitybit 3y agoEvery mitigation is code and complexity. There is always a cost.
- binkHN 3y agoNot for every mitigation. There are plenty of cases where OpenBSD removed code and functionality because of security implications.
- insanitybit 3y agoIn this case we got a code exec.
- __turbobrew__ 3y agoOpenBSD disabled hyperthreading before speculative execution attacks were in the wild. In the words of Greg K-H “OpenBSD was right”. There probably is some amount of security theatre in OpenBSD but they have also mitigated attacks which weren’t even known to exist.
- 0xDEAFBEAD 3y ago>they have also mitigated attacks which weren’t even known to exist Indeed, I'm reminded of some other comments that tptacek made in a recent thread, about how encrypting vulnerability disclosures "just isn't done": https://news.ycombinator.com/item?id=38563897 https://news.ycombinator.com/item?id=38563897 https://news.ycombinator.com/item?id=38569179 https://news.ycombinator.com/item?id=38569179 I'll bet the NSA is very happy about this situation and is doing everything they can to keep the gravy train rolling. I thought the entire point of being a good security person was that you're able to anticipate and defend against attacks before they become known... Isn't that what "security mindset" is supposed to entail?
- saagarjha 3y agoHe’s not wrong, though. Security researchers don’t use PGP when reporting vulnerabilities typically.
- tptacek 3y agoNSA doesn't care about your emailed vulnerability report. They're not spending their own money when they buy zero-day bug chains in platforms people actually use, and even if they were, those bug chains are so ludicrously cheap relative to their utility that any sigint (or law enforcement, for that matter) organization in the world, from Canada to El Salvador, can cheerfully afford them. Even if your emailed report was a complete bug chain and not, like, an X-Frame-Options redressing issue, it would be harder, and probably more expensive, for NSA to pick the bug up from email than it would be for them to simply fill out a purchase order from one of their private partners. As always it is helpful to remember as well that NSA's mission is to secure budget for NSA, full stop.
- bheadmaster 3y ago> Proper mitigations I think stem from proper design and threat modeling. Strong, reality-based statements like "this kills these vulnerabilities," or "this kills this CVE; it delays production of an exploit by one week." And also thorough testing by seasoned exploit writers. Anything else is relying on pure luck, superstition, and wishful thinking. The comment seems to imply that "proper design and threat modeling" must stem from real-world CVE-s and proofs of concept. That seems to me like "if nobody heard it, the tree didn't fall" kind of thinking. I'm sure OpenBSD developers have very good intuition on what could be used in a vulnerability, without having to write one themselves. And fortunately, they don't have a manager above them to whom they need to justify their billing hours.
- msm_ 3y ago>I'm sure OpenBSD developers have very good intuition on what could be used in a vulnerability, without having to write one themselves Why? On average programmers are not very good security engineers. And the opposite - security engineers are often not a good programmers. If your mitigation doesn't stop any CVE that's being exploited right now in the wild, it's an academic exercise and not particularly useful IMO. >And fortunately, they don't have a manager above them to whom they need to justify their billing hours. The point of the thread is that the mitigation cost right now may be low (the "billing hours"), but it's paid in perpetuity by everyone else downstream - in complexity, performance, unexpected bugs, etc. So having a manager or BDFL to evaluate the tradeoffs may be beneficial.
- bheadmaster 3y ago> If your mitigation doesn't stop any CVE that's being exploited right now in the wild, it's an academic exercise and not particularly useful IMO. If your only metric of security is "fixed CVEs", then you're rewarding mistakes that were rectified later, and punishing proactive approach to security that actually makes fewer CVEs appear in the first place. And Theo's reputation and influence on the security is evidence that what he does is more than just "academic exercise". E.g. he created OpenSSH. > The point of the thread is that the mitigation cost right now may be low (the "billing hours"), but it's paid in perpetuity by everyone else downstream - in complexity, performance, unexpected bugs, etc. While that may or may not be the pattern in general, it is not a rule, and especially doesn't apply in OpenBSD development. OpenBSD is widely regarded as one of the cleanest and most robust (free software) codebases ever.
- 0xDEAFBEAD 3y agoIs there a current meta for OpenBSD exploit developers? What's the right way to go about hardening the system if there's no meta to observe? My very naive take would be something like: A successful exploit depends on jumping through a number of different hoops. Each of those hoops has an estimated success probability associated with it. We can multiply all the individual probabilities together to get an estimated probability of successful exploit -- assuming that hoop probabilities are independent, which seems reasonable? The most efficient way to harden against exploits is to try and shrink whichever hoop possesses the greatest partial derivative of overall exploit success probability with respect to developer time.
- dtx1 3y ago> The most efficient way to harden against exploits is to try and shrink whichever hoop possesses the greatest partial derivative of overall exploit success probability with respect to developer time. Depending on your definition of efficient, adding more hoops should work exponentially better.
- 0xDEAFBEAD 3y agoMy definition of efficient is essentially whatever decreases the number of workable exploits most rapidly per hour of developer time. >Depending on your definition of efficient, adding more hoops should work exponentially better. Explain?
- nequo 3y agoSuppose your hoop probabilities are 25% and that you have two hoops so that the probability of jumping through both is 25% * 25% = 6.25%. You can reduce the size of one of the hoops in half, changing the probability to 25% * 25%/2 = 3.125% You can also add a third hoop, in which case the probability is 25% * 25% * 25% = 1.5625% 1.5625% < 3.125%, so adding a third hoop is better than shrinking one of the two existing hoops. Of course, this argument makes important assumptions about the hoop probabilities.
- wolverine876 3y ago> Classic thread on this stuff from Halvar Flake: That's from four years ago and does not address these technical issues. Are you going to pull it out every time OpenBSD is mentioned? I think people understand that you don't like their approach, etc., and the flaws you see, and that OpenBSD isn't designed for your interests.
- rs_rs_rs_rs_rs 3y ago>I think people understand that you don't like their approach, etc., and the flaws you see, and that OpenBSD isn't designed for your interests. OpenBSD isn't designed from anyone's interests. https://isopenbsdsecu.re/mitigations/ https://isopenbsdsecu.re/mitigations/
- wolverine876 3y agoOnly if you personally get to define other people's interests. Apparently they disagree!
- tptacek 3y ago"That's from four years ago" is a funny rebuttal to "classic thread".