News for hackers. Stuff that matters.
Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @06:55AM (#30396437)
Honestly at this point I’ve given in and am now advocating that we rewrite every damned widget from scratch in Rust, because by the time we’re mostly done, my career will be winding down, and seeing that shit still gets pwned like, exactly as much, will be “good TV”.

Rust is cool because it’s got a solid-if-slow build story that doesn’t really buy into the otherwise ubiquitous .so brain damage. Rust is cool because Haskell Lego Edition is better than no Haskell at all, and Rust is cool because now that it’s proven affine/linear typing can work, someone will probably get it right soon.

But if I can buy shares in: “shit still gets rocked constantly”, I’d like to know where.

Re:‘Zero-click’ hacks are growing in popularity by xavxav on Saturday February 19, 2022 @07:32AM (#30396651)
> Honestly at this point I’ve given in and am now advocating that we rewrite every damned widget from scratch in Rust, because by the time we’re mostly done, my career will be winding down, and seeing that shit still gets pwned like, exactly as much, will be “good TV”.

Rust won't solve logic bugs but it can help bring up the foundations. So long as memory safety bugs are so pervasive we can't even properly reason on a theoretical level about logic bugs. The core theorem of any type system is "type safety" which states that a well-typed program never goes wrong (gets stuck, aka UB). Only then can you properly tackle correctness issues.

> Rust is cool because Haskell Lego Edition is better than no Haskell at all, and Rust is cool because now that it’s proven affine/linear typing can work, someone will probably get it right soon.

I don't understand the condescending remarks about "Haskell Lego Edition". I do agree that Rust has shown that substructural type systems work and are useful, and that they will be a 'theme' in the next batch of languages (or I can hope).

Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @07:53AM (#30396788)
How much do I win if I can panic Rust without any “unsafe” whatsoever? Maybe I’ll index into some Unicode or something, haven’t decided.
Re:‘Zero-click’ hacks are growing in popularity by xavxav on Saturday February 19, 2022 @08:12AM (#30396904)
A crash is signficiantly better than corruption. If you can force an `unwrap` you can cause a denial of service but with corruption, all bets are off.
Re:‘Zero-click’ hacks are growing in popularity by kibwen on Saturday February 19, 2022 @08:02AM (#30396846)
Panicking in Rust isn't a memory-unsafe operation.
Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @08:00AM (#30396837)
And frankly I don’t see how it’s even remotely fair to call a no-nonsense statement that some things are simplified versions of other things with a cheeky metaphor “condescending”.

I could just as easily throw around words like “anti-intellectual” if my goal was to distract from the point rather substantially replying.

Re:‘Zero-click’ hacks are growing in popularity by kibwen on Saturday February 19, 2022 @08:05AM (#30396866)
But Rust isn't remotely a simplified version of Haskell, and I'm not sure where you got that impression. It's inspired by several languages, but is predominantly a descendant of ML and C++. The only similarity they have is that Rust traits resemble Haskell typeclasses, but even there they are quite different in semantics and implementation.
Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @08:47AM (#30397099)
I like Rust in a lot of ways, I write a fuckload of it and I get value from doing so. Not “praise the lord” value, but real value.

But the attitude is an invitation to getting made fun of. It’s absurdly intellectually dishonest when Rust-as-Religion people actively hassle anyone writing C and then get a little precious when anyone mentions Haskell and then extremely precious when they step on the landmine of the guy who likes Rust enough to know the standard, the compiler, the build tool, the people who wrote the build tool, and generally enough to put it in its place from a position of knowledge.

SSH servers? Yeah, I’d go with Rust. Web browsers? In a perfect world, lot of work. Even for Mozilla who timed the fuck out on it.

Everything ever so no security problem ever exists ever again? Someone called it the “green energy of software security” on HN like this year.

It’s not the coolest look that one of my “blow off some steam” hobbies is making those people look silly, but there are worse ways to blow off some steam.

Re:‘Zero-click’ hacks are growing in popularity by user3939382 on Saturday February 19, 2022 @10:21AM (#30397743)
It sounds like you’re saying, you spent a lot of time focused on learning rust, so now you like to discuss its shortcomings as abrasively as you can for sport.
Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @10:41AM (#30397890)
Upthread I’ve already surrendered. There are certain gangs you just don’t pick a fight with. I’m a slow learner in some ways but I get the message. Got it, learning Rust nuts and bolts only makes it worse to say anything skeptical about it.
Re:‘Zero-click’ hacks are growing in popularity by ascar on Saturday February 19, 2022 @11:48AM (#30398435)
Nearly every answer you gave in this thread doesn't address the parent comments point at all.

It seems you are just raging and reading subtext and drama where there is none.

Further up someone mentioned Rust and Haskell aren't similar and you go on about Rust-religion and where to use Rust. Why don't you just address the point? "Lego" is also not a synonym or metaphor for simplified.

Re:‘Zero-click’ hacks are growing in popularity by emerongi on Saturday February 19, 2022 @10:50AM (#30397948)
Your argument seems to mostly boil down to "Rust isn't magic", which nobody is really arguing. It does help eliminate one class of really nasty bugs, which tend to repeatedly show up in a lot of massive security hacks, and which generally everyone would like to see eliminated. Therefore: use Rust.

Comparisons to other languages like Haskell don't really work, since they don't fit in the same space nor have the same goals as Rust or C.

Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @10:52AM (#30397975)
Do I really need to do the search for comparisons to solar panels or cancer drugs, or does that sort of scan?
Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @08:23AM (#30396972)
Question mark operator is bind for Result? Derives show? Run that argument past someone who can’t quote chapter and verse.
Re:‘Zero-click’ hacks are growing in popularity by staticassertion on Saturday February 19, 2022 @04:31PM (#30400706)
lol if "shit still gets rocked" means "programs exit safely but unexpectedly sometimes" we're on very different pages

I'm searching your posts in this topic trying to find something of value and coming up short. You assert that you know rust, and therefor your opinions have merit, but... lots of people know rust and disagree. But somehow your opinions are More Right and the others are just religious Rust shills.

I don't think you know what you're talking about honestly. If you want to pick fights on HN that's cool, we all get that urge, but you're really bad at it.

Re:‘Zero-click’ hacks are growing in popularity by lionkor on Saturday February 19, 2022 @07:33AM (#30396654)
The flaw in the idea of "rewrite it in rust" is that, next to the memory issues, the biggest issues are logic bugs.

Rewriting something from scratch isnt going to magically not have bugs, and the legacy system likely has many edge cases covered that a modern new implementation will have to learn about first.

Re:‘Zero-click’ hacks are growing in popularity by xavxav on Saturday February 19, 2022 @07:40AM (#30396696)
Right, but a memory unsafety but is what takes a harmless logic bug in an image parser with no filesystem access to an RCE and sandbox escape.

Memory unsafety allows you to change the 'category' of the bug, you become free to do whatever whereas a logic bug forces to to work within the (flawed) logic of the original program.

Re:‘Zero-click’ hacks are growing in popularity by saagarjha on Saturday February 19, 2022 @10:25AM (#30397770)
Not necessarily; see https://github.com/LinusHenze/Fugu14/blob/master/Writeup.pdf for example. It's a full chain that repeatedly escalates privileges without exploiting any memory safety bugs by tricking privileged subsystems into giving it more access than it should have, all the way up through and beyond kernel code execution.
Re:‘Zero-click’ hacks are growing in popularity by dcsommer on Saturday February 19, 2022 @01:27PM (#30399248)
70% of high severity security bugs (including RCE) are due to memory unsafety. Not all, but most. It's been this way for~decades.

https://news.ycombinator.com/item?id=19138602

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

Re:‘Zero-click’ hacks are growing in popularity by Dagonfly on Saturday February 19, 2022 @03:25PM (#30400199)
These Rust vs C comparison often get fixated on the, somewhat unique, memory safety advantage of Rust. But the proper comparison should be ANY modern language vs. C, cause those remove a heap of other C footguns as well. Most modern language have:

- sane integers: no unsafe implicit cast, more ergonomic overflow/saturate/checked casts

- sane strings: slices with length, standardized and safe UTF-8 operations

- expressive typing preventing API misuse: monads like Optional/Result, mandatory exception handling, better typedefs, ADTs vs tagged unions

And even without the full Rust ownership model, I'd expect the following to solve a majority of the memory safety problems:

- array bounds checks (also string bounds checks)

- typed alloc (alloc a specific type rather than N bytes)

- non-null types by default

- double-free, use-after-free analysis

- thread-save std APIs

In the write-up you linked, Section 2 is a missing error check => Result<T> would surface that. The macOS case contains a relative path vs string comparison => expressive typing of Path would disallow that. DriverKit exploit is a Non-NULL vs NULL API mistake. Kernel PAC is a legit ASM logic bug, but requires a confusion of kernel stack vs. user stack => might have been typed explicitly in another language.

Re:‘Zero-click’ hacks are growing in popularity by jquery on Saturday February 19, 2022 @10:51AM (#30397960)
That’s not a zero-click vulnerability though. I didn’t read the entire pdf but 2 of the first 4 steps involve active user participation and assistance (install exploit app 1 and exploit app 2).

I think regardless, you’re right, we will still have logic bugs… but that example is also an “exception proves the rule” kind of thing.

Re:‘Zero-click’ hacks are growing in popularity by saagarjha on Saturday February 19, 2022 @10:55AM (#30398007)
It's not a zero click, that is correct. I presented it as an example of how every layers of Apple's stack, far beyond what is typically targeted by a zero-click exploit chain, can still have logic bugs that allow for privilege escalation. It's not just a memory corruption thing, although I will readily agree that trying to reduce the amount of unsafe code is a good place to start fixing these problems.
Re:‘Zero-click’ hacks are growing in popularity by Taywee on Saturday February 19, 2022 @08:11AM (#30396898)
An improvement is an improvement. A flaw of seatbelts is that some people still die when they wear them. That's not a valid argument to not wear seatbelts.
Re:‘Zero-click’ hacks are growing in popularity by GeekyBear on Saturday February 19, 2022 @12:31PM (#30398761)
>next to the memory issues, the biggest issues are logic bugs

When you look at the percentage of security issues that derive from memory safety, it certainly makes memory safety a good place to start.

>The Chromium project finds that around 70% of our serious security bugs are memory safety problems.

https://www.chromium.org/Home/chromium-security/memory-safet...

>Around 70 percent of all the vulnerabilities in Microsoft products addressed through a security update each year are memory safety issues.

https://www.zdnet.com/article/microsoft-70-percent-of-all-se...

Re:‘Zero-click’ hacks are growing in popularity by fulafel on Saturday February 19, 2022 @10:06AM (#30397643)
It's important to have good foundations (memory safety) because then it becomes much more attractive to spend effort on the rest of the correctness and security. If you want to build a sturdy house, and see how to make the roof well, don't give up on it just because you'll need to do something else for good doors and windows.
Re:‘Zero-click’ hacks are growing in popularity by omegalulw on Saturday February 19, 2022 @11:00AM (#30398051)
Do you imagine how long it would take to compile the Linux kernel if it were rust only? Not to mention the kernel has to allow for third party closed source stuff like drivers, wouldn't that force you to allow unsafe Rust and put you back to square one?
Re:‘Zero-click’ hacks are growing in popularity by dtech on Saturday February 19, 2022 @11:27AM (#30398273)
That seems an insignificant price to pay if it would truly provide the promised benefits (big if). Even most Linux users don't compile the kernel themselves, and the 5% that do care can afford the time and/or computing resources.
Re:‘Zero-click’ hacks are growing in popularity by axiosgunnar on Saturday February 19, 2022 @07:11AM (#30396534)
> Haskell Lego Edition

Gatekeeping much?

Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @07:14AM (#30396556)
I took the time to learn Rust well in spite of how annoying the Jehovas Witness routine has been for like, what, 5-10 years now? I worked with Carl and Yehuda both on the project right before Cargo (which is pretty solid, those guys don’t fuck around).

I think I’ve paid my cover-fee on an opinion.

Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @07:23AM (#30396603)
Do you have a different opinion on whether or not syntax for a clumsy Maybe/Either Monad is a bit awkward? Do you think that trait-bound semantics are as clean as proper type classes as concerns trying to get some gas mileage out of ad-hoc polymorphism? Do you think that the Rust folks might have scored a three-pointer on beating the Haskell folks to PITA-but-useable affine types?

Or were you just dissing knowing things?

Re:‘Zero-click’ hacks are growing in popularity by qualudeheart on Saturday February 19, 2022 @10:41AM (#30397889)
Mass rewrites will be quite the jobs program. I’m on board. Converted to Marxism not long ago.