code-423n4 / 2024-05-canto-findings

0 stars 0 forks source link

`context.Context` should be used everywhere instead of `sdk.Context`. This can lead to incorrect interfaces. #18

Closed howlbot-integration[bot] closed 4 months ago

howlbot-integration[bot] commented 4 months ago

Lines of code

https://github.com/code-423n4/2024-05-canto/blob/d1d51b2293d4689f467b8b1c82bba84f8f7ea008/canto-main/app/ante/interfaces.go#L13

Vulnerability details

Impact

sdk.Context is still used instead of context.Context, causing interface mismatch. I Won't go through all the instances in the project but there >400 places to update based on a vs code search for sdk.context

Proof of Concept

More information can be found here: https://github.com/cosmos/cosmos-sdk/blob/v0.50.6/UPGRADING.md

Specifically in the section Module.

Tools Used

Manual review

Recommended Mitigation Steps

Change sdk.Context to context.Context

Assessed type

Other

poorphd commented 4 months ago
3docSec commented 4 months ago

The linked docs explain how the Cosmos SDK changed the type of Context in their interfaces.

There is no evidence that applications like Canto need to drop the old one too.

c4-judge commented 4 months ago

3docSec marked the issue as unsatisfactory: Insufficient proof