This is less a problem with C and more a bad design decision by the musl team. In response to poor practices (programmers not checking what crypt returned), they built an arguably worse one (returning a sentinel value).
Sure, Rust's std::result can make it harder to dumb, but dumb can always find a way.
> You can very well write a Rust function that returns "*" if the password is too long. But the big difference between C and Rust in this regard is that the norms of the Rust community do not allow that.
Yeah, read that, laughed. While the statement may have some truthiness, if one flips it around it is basically saying that the norms of musl community allow programmers to be extra dumb.
Taking a different perspective, there are two intertwined thoughts in the original article and in most comments: 1) language safety, 2) community safety.
> This is not a memory safety vulnerability; rather, it is one of those issues that, people often say, languages with better type systems won’t save you from. This is true! You can very well write a Rust function that returns "" if the password is too long. But the big difference between C and Rust in this regard is that the norms of the Rust community do not allow that.*
If safety features are available and you choose not to use them then that's bad engineering.
I love K&R as much as the next guy but special magic ASCII chars multiply defined by convention over 40 years is exactly the sort of rubbish a good type system can protect against (if used).
I did read it. Again, it is blaming poor engineering on C. It's almost like saying people are e.g. stealing because they belong to certain socio-economic group. Crass.
"It's a shame, but what can we do? There really isn't anything we can do to prevent memory safety vulnerabilities from happening if the programmer doesn't want to write their code in a robust manner"
Oohhh there’s one more C vulnerability. Oh my gosh, what ever will I do? Should I buy a new smart toaster? I’m not sure. I just really don’t know what to do right now.
It’s called pay attention and f*king upgrade your packages.
This is less a problem with C and more a bad design decision by the musl team. In response to poor practices (programmers not checking what crypt returned), they built an arguably worse one (returning a sentinel value).
Sure, Rust's std::result can make it harder to dumb, but dumb can always find a way.
From the post:
> You can very well write a Rust function that returns "*" if the password is too long. But the big difference between C and Rust in this regard is that the norms of the Rust community do not allow that.
Yeah, read that, laughed. While the statement may have some truthiness, if one flips it around it is basically saying that the norms of musl community allow programmers to be extra dumb.
Taking a different perspective, there are two intertwined thoughts in the original article and in most comments: 1) language safety, 2) community safety.
Each needs to assessed on its own.
People in glass houses: https://github.com/nextest-rs/nextest/security/advisories/GH...
3 replies →
Except *sshole isn't a memory safety vulnerability - it's a logic bug. And logic bugs happen in every programming language.
Yes, this is explicitly discussed in the post:
> This is not a memory safety vulnerability; rather, it is one of those issues that, people often say, languages with better type systems won’t save you from. This is true! You can very well write a Rust function that returns "" if the password is too long. But the big difference between C and Rust in this regard is that the norms of the Rust community do not allow that.*
I just really hate rust compile times man
What does it have to do with C? It's just poor design.
It's like blaming poor driving on one's tracksuit.
If safety features are available and you choose not to use them then that's bad engineering.
I love K&R as much as the next guy but special magic ASCII chars multiply defined by convention over 40 years is exactly the sort of rubbish a good type system can protect against (if used).
I could see the same thing in Python. Except instead it would be an inhandled none they didn’t like so they would return a *.
I think if you read the post you will find the answer to your question.
I did read it. Again, it is blaming poor engineering on C. It's almost like saying people are e.g. stealing because they belong to certain socio-economic group. Crass.
1 reply →
It says "the norms of the Rust community" would prevent this vulnerability. So, it's about habits. The terms Rust and C in fact refer to habits.
3 replies →
obligatory https://xeiaso.net/shitposts/no-way-to-prevent-this/CVE-2024...
"It's a shame, but what can we do? There really isn't anything we can do to prevent memory safety vulnerabilities from happening if the programmer doesn't want to write their code in a robust manner"
Oohhh there’s one more C vulnerability. Oh my gosh, what ever will I do? Should I buy a new smart toaster? I’m not sure. I just really don’t know what to do right now.
It’s called pay attention and f*king upgrade your packages.