Re:Git Security Vulnerabilities Announced
by kibwen on Tuesday January 17, 2023 @03:00PM
(#34417945)
Furthermore, because integer overflow is defined behavior, the integer overflow is never considered a root cause in Rust. In order for an integer overflow to express as UB in Rust, you'd have to use it in conjunction with an `unsafe` block that was failing to ensure its invariants, and that would be considered the root cause. If you're not using `unsafe`, then an integer overflow is at worst a logic bug.
[ Parent
| on HN ]
Re:Git Security Vulnerabilities Announced
by p4l4g4 on Tuesday January 17, 2023 @04:05PM
(#34419104)
A logic bug can be dangerous too though. E.g. Bumping a user ID, to get a "fresh" one or calculate port to open based on offset. When not bounded to a known range, this kind of logic can easily pose a serious security risk. Most of the time, it will probably just work, but under extreme conditions, it will fail. If your language at least catch the overflow and crash instead of wrapping around, you "only" have a denial of service.
Can imagine that implementing bounds checking can be costly, when done in software. Wonder if there are any hardware improvements that could reduce risk in this area.
Re:Git Security Vulnerabilities Announced
by wongarsu on Tuesday January 17, 2023 @05:41PM
(#34420534)
If you identify an area as risky, it's trivial in Rust to do a checked_add or saturating_add. The challenge is obviously identifying this, but having easy library functions anectotally leads to people looking for it in code reviews.
Re:Git Security Vulnerabilities Announced
by kibwen on Tuesday January 17, 2023 @07:57PM
(#34421913)
Indeed, nobody ever said that logic bugs were good, but as a category of flaw it means that integer overflow in Rust isn't particularly interesting compared to all the other innumerable ways to introduce logic bugs. And I say that as someone who wouldn't really mind if the behavior was changed to panic-by-default in release mode.
Re:Git Security Vulnerabilities Announced
by astrange on Tuesday January 17, 2023 @04:34PM
(#34419597)
A logic bug can be just as bad as any other kind of bug. Security bugs/memory corruption don't always deserve the extra special treatment they get, nor are they the only kind of remotely exploitable issue.