sherlock-audit / 2024-06-allora-judging

0 stars 0 forks source link

0xsi - Inadequate Error Handling in CLI Commands in `cmd/commands.go` #35

Closed sherlock-admin4 closed 4 months ago

sherlock-admin4 commented 4 months ago

0xsi

High

Inadequate Error Handling in CLI Commands in cmd/commands.go

Summary

There is no proper error handling in initRootCmd function.

Vulnerability Detail

The initRootCmd function adds multiple commands to the root command without proper error handling. If an error occurs during the addition of these commands, it will not be captured or logged, leading to potential silent failures.

Impact

If an error occurs during the initialization of CLI commands, it may go unnoticed, causing certain commands to be unavailable or malfunction without any indication to the user. This can hinder the usability and reliability of the CLI.

Code Snippet

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

Tool used

Manual Review

Recommendation

Add error handling for each command addition to ensure any issues are captured and logged. This will help identify and debug problems during CLI initialization.

sherlock-admin4 commented 4 months ago

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

0xmystery commented:

Insufficient proof