Re:Git Security Vulnerabilities Announced
by dcsommer on Tuesday January 17, 2023 @02:56PM
(#34417881)
Integer overflow isn't a security issue unless your program's memory safety depends on the correctness of the integer operation. Safe rust doesn't (in any build mode), but C/C++ does.
[ Parent
| on HN ]
Re:Git Security Vulnerabilities Announced
by hyperhopper on Tuesday January 17, 2023 @03:17PM
(#34418258)
You don't know the business logic of every program. You can't say that a rust program won't have a security issue due to this.
`UserAccessLevel > Threshold`
Like there could be a million ways an integer becoming small could mess up something.
Also there are business logic issues as well
Re:Git Security Vulnerabilities Announced
by HideousKojima on Tuesday January 17, 2023 @03:44PM
(#34418710)
Sure, but a logic error is a fundamentally different class of error compared to a memory error. The potential harm of a logic error is limited in scope to what the program was written to be able to do. A memory error can lead to arbitrary code execution.
Re:Git Security Vulnerabilities Announced
by naniwaduni on Tuesday January 17, 2023 @04:55PM
(#34419920)
Logic errors can still be security issues, even if they don't violate memory safety.
Re:Git Security Vulnerabilities Announced
by HideousKojima on Tuesday January 17, 2023 @05:05PM
(#34420065)
Absolutely, and I didn't suggest otherwise. But a logic error generally won't lead to your entire system getting pwned unless the program that has the logic error is one for something like user administration or managing a database etc.
Re:Git Security Vulnerabilities Announced
by shiftingleft on Tuesday January 17, 2023 @03:03PM
(#34418016)
To elaborate on this: Rust always performs bounds checks on array accesses, so you can't get an out-of-bound read/write.
Re:Git Security Vulnerabilities Announced
by AlexAndScripts on Tuesday January 17, 2023 @05:41PM
(#34420546)
Is there a way to turn this off?
Re:Git Security Vulnerabilities Announced
by kibwen on Tuesday January 17, 2023 @06:12PM
(#34420866)
Not via a compiler flag, no. The way to "opt out" of bounds checks is to replace `foo[bar]` with `unsafe { foo.get_unchecked(bar) }` at a given callsite. And the use of `unsafe` is going to immediately raise the eyebrow of any code reviewer or auditor.
Re:Git Security Vulnerabilities Announced
by IncRnd on Tuesday January 17, 2023 @03:47PM
(#34418782)
> Integer overflow isn't a security issue unless your program's memory safety depends on the correctness of the integer operation.
That's simply not true and has wide-reaching horrible effects that can occur. The wrong number of tickets can be purchased from a website, charging for less than were purchased. The DNR order can be put in place instead of SAVE LIFE. There are countless security issues that can occur.
Saying that integer overflow is only an issue for memory safety is really bad and incorrect advice.
Re:Git Security Vulnerabilities Announced
by unshavedyak on Tuesday January 17, 2023 @04:00PM
(#34419021)
That's most logic issues though, is it not? I agree with you though, i wish Rust more commonly pushed "safer" (not in the UB way) code, like `Vec::get` and `u32::overflow_add` and etc.
Luckily lints help to easily ban the arithmetic/etc ops from projects. Nevertheless i feel it should be a bit closer to Rust's home.
Re:Git Security Vulnerabilities Announced
by dcsommer on Tuesday January 17, 2023 @04:06PM
(#34419126)
Do you have data on the relative frequency and severity of non-memory safety integer overflow security issues?
Re:Git Security Vulnerabilities Announced
by hot_gril on Tuesday January 17, 2023 @08:23PM
(#34422187)
I know at least about the DAO hack.
Re:Git Security Vulnerabilities Announced
by IncRnd on Tuesday January 17, 2023 @10:53PM
(#34423273)
Here are over 3k CVEs that contain "integer overflow". That shouldn't be considered a comprehensive search.
https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=integer+ove...
Re:Git Security Vulnerabilities Announced
by hyperhopper on Wednesday January 18, 2023 @03:18AM
(#34424535)
You don't need to have to have historical stats to show that it can be a security issue.