Open feezybabee opened 10 months ago
I can confirm that I can reproduce the panic with the attached program with 6b2a814d28ec63235fead411726b8ec6ab22b4c6 (current testnet3); as long as the problematic conditions are possible, this could also lead to incorrect results in release
builds.
@ljedrz same as the other recent related low level reports, this is an invalid bug submission and they did not show anything actually exploitable, but it would be nice to fix our inner function API at some point.
Summary:
The attacker can trigger integer overflow function EvaluationDomain::reindex_by_subdomain() when using the big input index.
Consider the following branch:
i
is controllable variable (equal toindex - other.size()
). At the same time, there are nousize
bounds checks in the code. Let's consider the case whereother.size() = 1
,self.size() = 2
andindex = usize::MAX / 2 + 2
. In this caseusize
will overflow and the result will be equal to:usize::MAX + 2 = 1
in release buildProof-of-Concept (PoC)
Cargo.toml
src/main.rs
Result (release)
Result (debug)
Impact
The severity of this issue will strongly depend on the use of the function in the code. The issue may lead to DoS and to more serious problems (since the code will not panic in release builds, but will still provide an incorrect result).