Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

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

@insanitybit
Submissions

comment 7y ago · link · parent

Well, that's not really a fair interpretation of my argument, I'd say.

My argument is:

* We have a production, widely used codebase

* This codebase is in C++

* This codebase has probably the most significant efforts to secure it of anything of its size, or at least it's in the top 5

* This codebase suffered enouguh critical vulnerabilities for users to be attacked in the wild

So let's be clear - Chrome suffers from thousands of memory safety vulnerabilities, but not many make it to ITW exploits. This case is special because users actually suffered because of it. It isn't fair to say they've had "one security issue", certainly, just one that's had major user impact.

I'm not judging C++ or the choice to use it. I am saying that this is an example of a very hardened system not being able to compensate for memory unsafety.

comment 7y ago · link · parent

To be clear, I'm not saying "Chrome should be rewritten in a memory safe language", I'm saying that Chrome is an excellent project to point to, say "Wow, no one does as much to secure a codebase as them", and to follow that up with "and they still got owned".

comment 7y ago · link · parent

I didn't say C++ was a bad choice and I've purposefully avoided making this another language war issue.

What I'm saying is that Chrome is an example of a project with more security funding than just about any other project out there, and it still can't save users from the footguns of C++.

I guess the question used the wording "should have written it in?", to which I said "a memory safe one", and that's not true. I'm not interested in making a judgment call on their initial choice - I totally get the decision, regardless.

comment 7y ago · link · parent

The question is, how much effort is it to keep users safe given language X vs C++.

Apparently, when the language is C++, the value is somewhere above many millions of dollars, and we don't know what it is.

Can we reasonably expect that price to be lower with language X? For many reasons, I would argue 'yes'.

comment 7y ago · link · parent

A memory safe one. There are many of them. They could build their own if they chose to - they've built multiple languages in the past.

Picking a language for the Chrome team doesn't seem practical - we all know where your question is going to head.

The point is they have to not pick C++. Again, they've invested many, many millions of dollars into security. Let's not pretend that they're priced out of using another language.

comment 7y ago · link · parent

I'll be that guy.

Chrome has probably invested > 1 billion dollars into their codebase at this point. Certainly >100million into security.

They sandbox their code aggressively. They build this project with security in mind from day 1 - it's been architected for it.

The Chrome security team(s) has a lot of power for a product security org.

They fuzz. They invent new fuzzers. They cluster their fuzzers.

They have a world class bounty program.

They have a world class research team for finding vulns.

They invent or otherwise aggressively adopt mitigation techniques.

But someone out there did it.

Their track record for security is something to really be proud of - this is the first public ITW exploit of its type that I am aware of. But users are getting owned because of, at the very least, a Use After Free vulnerability.

Let's just collectively admit it, finally - you can't write safe C++ in a codebase this complex.

edit: (From a post below)

To be clear, I'm not saying "Chrome should be rewritten in a memory safe language", I'm saying that Chrome is an excellent project to point to, say "Wow, no one does as much to secure a codebase as them", and to follow that up with "and they still got owned by UAF".

comment 7y ago · link · parent

Since its inception I am aware of a single (this situation) case of an ITW exploit. So, that's why.

comment 7y ago · link · parent

It's not. The short answer is it's the same thing as Rust, except instead of a compile time guarantee that your state isn't reused I have an assertion and test coverage.

comment 7y ago · link · parent

Oh, yes, I see the miscommunication now. Phantom types can be leveraged in a similar way, where a type (the phantom type that you are generic over) represents that state. To answer your question - the end result of both approaches is a session type with the same guarantees.

I've seen that approach used but I can't really comment too much on the differences as I've never used it myself. I find my approach simple in practice (I've shipped Python code that takes the same approach, sans affine types) because it separates the types out.

So, essentially, I write my non-sesssiony struct with all of its methods, and then I wrap that in the session types. This lets me easily drop into the non-session type if necessary, and the sessions types act as thin wrappers. My imap client worked the same way, if I recall.

The downside is likely boilerplate.

comment 7y ago · link · parent

Sure, feel free to read 'communication protocol' where I say state machine.

comment 7y ago · link · parent

I wrote that insanitybit post. It's unrelated to Phantom types.

A session type allows you to encode a state machine into your type system. What this means is that, at compile time, you can validate that your code can't transition into an invalid state.

comment 7y ago · link · parent

Well, they did, right? So that doesn't seem true.

comment 7y ago · link · parent

Check out aws-cdk ?

comment 7y ago · link · parent

There's one really major distinction - you can `grep` for `unwrap`. You could grep for null, but that won't tell you if an NPE elsewhere is possible, and it won't hit every single case (like 3rd party libs returning null).

Making bugs grep'able is huge.

comment 7y ago · link · parent

It isn't a column. It's where the mixed content and other flags are (The vertical strip of 3 dots).

You can use the "*" scope and enable "Forbid web workers".

Be warned that this will break Google's captcha.

comment 7y ago · link · parent

uMatrix also allows you to whitelist web workers, which are a typical component for js crypto mining

comment 7y ago · link · parent

Like I said, a big part of feeling confident in my choice to use DGraph is the direction - the improvements to the QL and performance, as well as the Jepsen tests, are exactly the work I want to see as a consumer.

And that is one hell of an improvement. Nice work.

comment 7y ago · link · parent

I've been using DGraph for quite a while now in a side project of mine.

I looked at a number of other graph dbs, and landed on dgraph for a few reasons.

a) I like the query language. It felt natural to me. That's just my opinion though. Other languages felt cumbersome, and I didn't feel like I was operating on a graph.

b) I needed write performance. I'd talked to colleagues about their experiences (I have some friends at graphy companies) and every time I asked "what about X graphdb? could it handle this write load?" the answer was "no, definitely not".

I chose dgraph and it's been working like champ. Support via slack has been solid, they're focusing on the right things (performance, correctness), and I have a lot of confidence in the future of the project.

comment 7y ago · link · parent

I'll echo this - I learned about graph databases using DGraph.

comment 7y ago · link · parent

Where Neptune appears to fall down is write performance. This is what made it non-viable for me. I have colleagues who are struggling / hacking around the write performance issues.

DGraph's write perf seems to be considerably better - I haven't benchmarked formally, just going off of discussions I've had with others.

comment 7y ago · link · parent

This argument makes no sense at all. What does lock in have to do with Amazon dog fooding its services? They're... trying to lock themselves in? What?

comment 7y ago · link · parent

Do you think all of the companies that chose Cassandra and Dynamo were wrong to do so? There's no use case for NoSQL? There were no lessons learned, value adds from NoSQL?

How do you explain the 'NewSQL' approach, which seems to be so clearly borne of what we've learned from NoSQL?

It should be obvious that NoSQL has value, regardless of the issues with one of the earlier NoSQL DBs.

comment 7y ago · link · parent

I didn't intend to characterize it as an attack. I read it as an assumption, or an unwitting implication, which I don't blame you for because the issue (of treating frontend devs as lesser) is systemic.

No attacking on either side.

comment 7y ago · link · parent

I also did not read it that way. I read it as an off-hand remark that unwittingly implied that frontend devs were 'others' with different requirements.

comment 7y ago · link · parent

Tell that to AWS. They've banned relational databases for specific workloads because Dynamo (nosql) provides more consistent performance, and is easier to operate.

Tons of conflation of Mongo's problems with those of nosql in this thread.

comment 7y ago · link · parent

Sorry, but I'll point out a bit of elitism in this post.

> (Unless if the job description is for front-end development only, in which I'm less qualified to say whether a CS education is needed or not.)

The browser is an extremely complex platform, at least rivaling an operating system. If you're going to argue that advanced knowledge of a platform is required for non-frontend work, you should be comfortable making the argument for frontend.

Except people generally don't make that argument. Frontend devs (I am not one) are looked down on. But it's a double standard.

I'm sure that wasn't your intention, but it's a constant expression I see - that web developers are a class separate from the rest of us. The truth is that OS knowledge is not critical and the general sentiment that frontend devs can do their job without understand the complexities of a browser only reveals this.

More to your point, I taught myself about OS's and x86 outside of class because I wanted to learn how to exploit memory safety issues. I never made a career out of it, but I learned a lot, and it was a matter of buying a few books and talking to people on IRC. I found tons of excellent talks by Herb Sutter and Scott Meyer about CPU architecture and how code maps to it.

There's a ton of resources out there for those who choose to self-teach.

comment 7y ago · link · parent

I think it is definitely beyond language. The condescension of 'you don't have to be humiliated to be a blue collar worker' is absurd in any language - the assumption that workers are embarrassed to not be one of the Elite Engineers.

The statement that you are not to call yourself a programmer, you haven't earned it, you're not a real programmer.

The justification against being self taught amounts to - 'well you can't work for NASA, and uh, something about learning to be a professional'? I found it particularly ironic that they pointing out how many big projects started in academia - and how many of the largest companies were started by dropouts?

The author acts as if they're exploring the idea, but it's not an exploration, it's an argument that they clearly already had made their mind up on.

comment 7y ago · link · parent

I had a longer post. I've deleted it. What I'll say is that I did not find the article convincing at all.

I'm quite biased, as I found it incredibly insulting throughout the article, as I myself dropped out of college.

I believe that college is a viable path with many benefits. I believe self taught is another viable path with many benefits.

I am a programmer, and I dislike an article saying that I am not because I chose to exit my university early and join the work force.

comment 7y ago · link · parent

Similarly, the intellij plugin for Rust will reveal implicit type annotations.

comment 7y ago · link · parent

And Go isn't memory safe given race conditions.

If you're using goroutines you may want to consider fuzzing with the race detector.

1
140141142
164