sherlock-audit / 2024-06-allora-judging

0 stars 0 forks source link

0xsi - Lack of Validation for `appOpts` Type in `cmd/commands.go` #34

Closed sherlock-admin3 closed 4 months ago

sherlock-admin3 commented 4 months ago

0xsi

Medium

Lack of Validation for appOpts Type in cmd/commands.go

Summary

There is no validation for appOpts type.

Vulnerability Detail

In the appExport function, the type assertion for appOpts to *viper.Viper is performed without validation. If the assertion fails, an error message is returned, but no further action is taken to handle this scenario.

Impact

In the appExport function, the type assertion for appOpts to *viper.Viper is performed without validation. If the assertion fails, an error message is returned, but no further action is taken to handle this scenario.

Code Snippet

https://github.com/sherlock-audit/2024-06-allora/blob/main/allora-chain/cmd/allorad/cmd/commands.go#L132-L138

Tool used

Manual Review

Recommendation

Perform a type check and handle the scenario where appOpts is not of the expected type. Provide a fallback mechanism or a detailed error message to guide the user.

sherlock-admin2 commented 4 months ago

1 comment(s) were left on this issue during the judging contest.

0xmystery commented:

Insufficient proof