News for hackers. Stuff that matters.
Re:OpenSSL Security Advisory by IgorPartola on Thursday March 25, 2021 @11:32AM (#26581505)
But what if we rewrite it all in Rust bugs become impossible! /s
Re:OpenSSL Security Advisory by bluejekyll on Thursday March 25, 2021 @12:11PM (#26582026)
You jest, but at least in this case looking at both of the changes, these bugs wouldn't have happened in Rust.

Better options for standard data structures and initialization: https://github.com/openssl/openssl/commit/fb9fa6b51defd48157...

Error handling: https://github.com/openssl/openssl/commit/2a40b7bc7b94dd7de8...

Re:OpenSSL Security Advisory by tptacek on Thursday March 25, 2021 @03:23PM (#26584313)
I don't think there's a strong argument for the second one in Rust. It's not an error handling bug as much as a simple logic bug; it's aggregating the results of multiple checks.
Re:OpenSSL Security Advisory by bluejekyll on Thursday March 25, 2021 @03:33PM (#26584415)
Perhaps not a strong argument, but in idiomatic Rust (i.e. if you ran clippy on it and it passes checks) I'm fairly certain it would be less likely to happen.

That said, of course you can end up with a similar bug in Rust, there are just nice ways the language encourages practices that would avoid it.

Re:OpenSSL Security Advisory by tptacek on Thursday March 25, 2021 @05:30PM (#26585645)
I don't want to belabor this too much. Rust has a lot of exhaustive checking tools that other languages don't, so I don't want to claim that it would do nothing to reduce the likelihood of these kinds of mistakes. But if I go to my 3p directory and grep across all the Rust dependencies I've got, I can find plenty of code that has, like, `let mut checked = false` and that goes on to compute `checked`. That's what basically happened here. None of the individual checks were missed; they were just aggregated into a result improperly.
Re:OpenSSL Security Advisory by unilynx on Thursday March 25, 2021 @11:39AM (#26581602)
Moving all ASN/X509 handling to Rust might be worth it though. That stuff is a minefield and has had plenty of memory-safety issues in the past.
Re:OpenSSL Security Advisory by mroche on Thursday March 25, 2021 @02:37PM (#26583750)
Genuine question as I'm not a Rust professional, but if one was able to maintain the C API and headers to produce a drop in replacement for the current openssl implementation, would rewriting it in Rust produce a safer variant?

This would be based off using the #[no_mangle] extensively, I presume, probably with some amount of "unsafe" usage? At which point has the primary use case of Rust in this situation been lost?

Re:OpenSSL Security Advisory by bluejekyll on Thursday March 25, 2021 @03:26PM (#26584342)
What you're probably looking for is this project, which is a C API (I think ABI compatible) wrapper around Rustls that can be a "drop-in" replacement for OpenSSL: https://mesalink.io/

(note: not commenting on if one should or should not use it, only mentioning it's existence)

Re:OpenSSL Security Advisory by PoignardAzur on Thursday March 25, 2021 @03:56PM (#26584649)
You're joking, but the audit of rustls last year by Cure53 concluded with "We were unable to uncover any application-breaking security flaw" and "the team of auditors considered the general code quality to be exceptional".

https://github.com/ctz/rustls/blob/master/audit/TLS-01-repor...