You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found by auditing the code for Stargate and preparing to fuzz it, if any path is provided with a trailing slash for example just by simply passing in "m/16/19/" instead of "m/16/19" or even "/", or "m/16//10"
…ng slashes
Detected during my audit, right before fuzzing, the code that
checked for presence of hyphens per path segment assumed that
the part would always be non-empty. However, with paths such as:
* m/4/
* /44/
* m/4///
it'd panic with a runtime slice out of bounds.
With this new change, we now:
* firstly strip the right trailing slash
* on finding any empty segments of a path return an error
Fixes#8557
…ng slashes (#8607)
Detected during my audit, right before fuzzing, the code that
checked for presence of hyphens per path segment assumed that
the part would always be non-empty. However, with paths such as:
* m/4/
* /44/
* m/4///
it'd panic with a runtime slice out of bounds.
With this new change, we now:
* firstly strip the right trailing slash
* on finding any empty segments of a path return an error
Fixes#8557
…ng slashes (#8607)
Detected during my audit, right before fuzzing, the code that
checked for presence of hyphens per path segment assumed that
the part would always be non-empty. However, with paths such as:
* m/4/
* /44/
* m/4///
it'd panic with a runtime slice out of bounds.
With this new change, we now:
* firstly strip the right trailing slash
* on finding any empty segments of a path return an error
Fixes#8557
(cherry picked from commit f970056)
…ng slashes (#8607) (#8608)
Detected during my audit, right before fuzzing, the code that
checked for presence of hyphens per path segment assumed that
the part would always be non-empty. However, with paths such as:
* m/4/
* /44/
* m/4///
it'd panic with a runtime slice out of bounds.
With this new change, we now:
* firstly strip the right trailing slash
* on finding any empty segments of a path return an error
Fixes#8557
(cherry picked from commit f970056)
Co-authored-by: Emmanuel T Odeke <[email protected]>
Summary of Bug
Found by auditing the code for Stargate and preparing to fuzz it, if any path is provided with a trailing slash for example just by simply passing in "m/16/19/" instead of "m/16/19" or even "/", or "m/16//10"
results in this panic
Version
All versions with this code
Cause
This code
cosmos-sdk/crypto/hd/hdpath.go
Lines 190 to 192 in c54025d
assumes that ALL the parts will have a non-empty string, but that's clearly not true, if a path with a trailing slash were passed it, it'd crash.
Remedy
Before that
part[len(part)-1] == "'"
, we need to check that the segment is non-empty. There is 2 fold remedy:Let's please backport this change to all releases like Stargate et al.
For Admin Use
The text was updated successfully, but these errors were encountered: