Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions

@insanitybit
Submissions

comment 5y ago · link · parent

Rust has no concept of a process, same as it has no concept of a thread. So you'd build a safe abstraction for sharing memory across processes the same way you do today with threads.

comment 5y ago · link · parent

It must have changed a shitload in the last 2-3 years if that's the case. What tools are you referring to? I'm pretty familiar with C++ tooling but I haven't paid attention for a little while.

comment 5y ago · link · parent

OK, but I didn't say that no one can write C without bugs. I said that blaming languages is good, that we'll all lose due to people continuing to use C, that C programs aren't inherently smaller and faster than other languages, and that people should treat writing C as they would treat writing crypto.

comment 5y ago · link · parent

I assume by capabilities they mean specifically a capabilities-based security model.

comment 5y ago · link · parent

The problem is that the current state of operating systems is terrible. There's almost no isolation, tons of complexity, tons of attack surface, lock-in, etc.

Browsers are a massive improvement as a platform for developing code, or at least they have the potential to be.

comment 5y ago · link · parent

> Not sure what your last sentence means - without evidence, there are cases when we guess right, and those when we guess wrong. Are you just choosing to ignore the latter?

What I'm saying is that truth is a matter of debate. We believe lots of things based on evidence much less rigorous than a formal proof in many cases - like most modern legal systems, which rely on various types of evidence, and then a jury that must form a consensus.

So saying "there is no evidence" is sort of missing the point. Safe Rust does not have memory safety issues, barring compiler bugs, therefor common sense as well as experience with other languages (Java, C#, etc), would show that that memory safety issues are likely to be far less common. Maybe that isn't the evidence that you're after, but I find that compelling.

To me, the question of "does rust improve upon memory safety relative to C/C++" is obvious to the point that it really doesn't require justification, but that's just me.

I could try to find more evidence, but I'm not sure what would convince you. There's people fuzzing rust code and finding far fewer relevant vulns - but you could find that that's not compelling, or whatever.

comment 5y ago · link · parent

It's just tinfoil hat nonsense, it's not worth responding to.

comment 5y ago · link · parent

Saying "show me the vulns in this codebase" over and over is not a good argument.

comment 5y ago · link · parent

> 1. Blaming the language instead of the programmer will not lead to improved program quality.

I disagree. Blaming the language is critically important. Tony Hoare (holds a turing aware, is a genius) puts it well.

> a programming language designer should be responsible for the mistakes that are made by the programmers using the language. [...]

> It's very easy to persuade the customers of your language that everything that goes wrong is their fault and not yours. I rejected that...

[0]

> Users will still be write programs in C for their own personal use that are smaller and faster than ones written in memory-safe. languages

Users will always write C. No they won't always be smaller and faster.

> 3. Those in the future who are practiced in C will have a siginificant advantange in being able to leverage an enormous body of legacy code

Much to society's loss, I'm sure.

> and may in fact be taught to fear it

Cool. Same way we teach people to not roll their own crypto. This is a good thing. Please be more afraid.

> There is a tremendous amount of C code that DOES NOT contain buffer overflows or use-after-free errors.

No one cares. Not only is that not provably the case, nor is it likely the case, but it's also irrelevant when I'm typing on a computer with a C kernel, numerous C libraries, in a C++ browser, or texting someone via a C++ app that has to parse arbitrary text, emojis, videos, etc.

> Find me a buffer overflow or use-after-free in one of djb's programs.

No, that's a stupid waste of my time. Thankfully, others seem more willing to do so[1] - I hate to even entertain such an arbitrary, fallacious benchmark, but it's funny so I'll do it just this once.

[0] http://blog.mattcallanan.net/2010/09/tony-hoare-billion-doll...

[1] http://www.guninski.com/where_do_you_want_billg_to_go_today_...

comment 5y ago · link · parent

> Hand a YubiKey to your CEO and their secretary.

Well, I'm the CEO lol so we have an advantage there.

> The problem is that the recent security company purchases suggest that it costs roughly $100 per month per user to have just basic security.

Totally, this is a huge issue to me. I strongly believe that we need to start getting TPMs and hardware tokens into everyone's hands, for free - public schools should be required to give it to students when they tell them to turn in homework via some website, government organizations/ anyone who's FEDRAMP should have it mandated, etc. It's far too expensive today, totally agreed.

edit: Wait, per month? No no.

> We don't need better crypto.

FWIW the kicker with yubikeys isn't really anything with regards to cryptography, it's the fact that you can't extract the seed and that the FIDO2 protocols are highly resistant to phishing.

comment 5y ago · link · parent

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.

comment 5y ago · link · parent

Yeah I mean, 100%, I hate that I run my code on Linux, which I don't consider to be a well secured kernel. It's an unfortunate thing, but such is life.

But attackers have significantly less control over that layer. This is quite on topic with regards to security nihilism - my parser code being memory safety means that the code that's directly interfacing with attacker input is memory safe. Is the allocator under the hood memory safe? Nope, same with various other components - like my TCP stack. But again, attackers have a lot less control over that part of the stack, so while unfortunate, it's not my main concern.

I do hope to, in the future, leverage a much much more security optimized stack. I'd dive into details on how I intend to do that, but I think it's out of scope for this conversation.

comment 5y ago · link · parent

Yep, I definitely get what you're saying and strategic communication is totally worthwhile (I'm a CEO, the value is absolutely not lost on me). It's just not something I prioritize on HN, that's just the personal call I make.

comment 5y ago · link · parent

I mentioned Rust because I write Rust professionally. If I wrote Java professionally, as I used to, I would have said "java". So you're probably correct that I could preempt stupid people's posts, but I don't care about the dregs of HN reading into my very clear, simple statement, just because they're upset about rust or whatever. It's just not worth it to me.

I'm glad the post was of value to you. The talk is really good and I think more people should read it.

comment 5y ago · link · parent

That's not true, actually. There is more than "literally zero" evidence. I don't feel like finding it for you, but at minimum Mozilla has published a case study showing that moving to Rust considerably reduced the memory safety issues they discovered. That's just one example, I believe there are others.

There are likely many other examples of, say, Java not having memory safety issues. Java makes very similar guarantees to Rust, so we can extrapolate, using common sense, that the findings roughly translate.

Common sense is a really powerful tool for these sorts of conversations. "Proof" and "evidence" are complex things, and yet the world goes on with assumptions that turn out to hold quite well.

comment 5y ago · link · parent

> Rust's typesystem, on the other hand, can really get in the way and make code more opaque and more difficult to understand.

I don't disagree with the premise of your post, which is that time spent on X takes away from time spent on security. I'll just say that I have not had the experience, as a professional rust engineer for a few years now, that Rust slows me down at all compared to GC'd languages. Not even a little.

In fact, I regret not choosing Rust for more of our product, because the productivity benefits are massive. Our rust code is radically more stable, better instrumented, better tested, easier to work with, etc.

comment 5y ago · link · parent

Totally. I said Rust because I write Rust. Like, that's (part of) my job. Rust is no more memory safe (to my knowledge) than Swift, Java, C#, etc.

I also said "way, way less" not "not at all". I still think about memory safety in our Rust programs, I just don't allocate time to address it (today) specifically.

comment 5y ago · link · parent

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.

comment 5y ago · link · parent

Yes, if you don't trust Google don't use a key from Google. Is that what you're trying to say? If your threat model is Google don't buy your key from Google. Do I think that's probably a stupid waste of thought? Yes, I do. But it's totally legitimate if that's your threat model.

comment 5y ago · link · parent

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.

comment 5y ago · link · parent

I'm a security professional so it's based on being an experienced expert, not some sort of hype or misplaced enthusiasm.

comment 5y ago · link · parent

Just the other day I suggested using a yubikey, and someone linked me to the Titan sidechannel where researchers demonstrated that, with persistent access, and a dozen hours of work, they could break the guarantees of a Titan chip[0]. They said "an attacker will just steal it". The researchers, on the other hand, stressed how very fundamentally difficult this was to pull off due to very limited attack surface.

This is the sort of absolutism that is so pointless.

At the same time, what's equally frustrating to me is defense without a threat model. "We'll randomize this value so it's harder to guess" without asking who's guessing, how often they can guess, how you'll randomize it, how you'll keep it a secret, etc. "Defense in depth" has become a nonsense term.

The use of memory unsafe languages for parsing untrusted input is just wild. I'm glad that I'm working in a time where I can build all of my parsers and attack surface in Rust and just think way, way less about this.

I'll also link this talk[1], for the millionth time. It's Rob Joyce, chief of the NSA's TAO, talking about how to make NSA's TAO's job harder.

[0] https://arstechnica.com/information-technology/2021/01/hacke...

[1] https://www.youtube.com/watch?v=bDJb8WOJYdA

comment 5y ago · link · parent

Computing any hash isn't, but finding a preimage is NP.

comment 5y ago · link · parent

Yes, I have.

comment 5y ago · link · parent

Everybody dies. I can only make so many sacrifices.

comment 5y ago · link · parent

Or we just get US companies to step up their security. US infra is a ridiculous soft target.

comment 5y ago · link · parent

Oh, my question was genuine, I wasn't trying to be like "you DONT have experience". I was just curious.

Rereading my post it sounds like I'm trying to disagree, I'm no expert either.

comment 5y ago · link · parent

Awesome, much appreciated, I'll dig into it. I was actually just using the dalek crate myself quite heavily this week, so this is great timing.

comment 5y ago · link · parent

I'm setting the bar super low. A `./configure` and a readme with basic info about the project and how to build/run it would be quite exceptional. I don't need them to be triaging github issues and merging in PRs.
1
848586
164