CVE-2024-37153: Github.com/evmos/evmos/v18 Contract Balance Not Updating Correctly Vulnerability
HIGHCVE-2024-37153 is a HIGH (CVSS 7.5) contract balance not updating correctly vulnerability (CWE-670: Always-Incorrect Control Flow Implementation) affecting Github.com/evmos/evmos/v18 libraries in the Go ecosystem. The issue involves contract balance not updating correctly after interchain transaction. Remediation is available by upgrading affected packages to version 18.1.0.
CVE-2024-37153 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2024-37153
To remediate this vulnerability, upgrade all affected Github.com/evmos/evmos/v18 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/evmos/evmos/v18 to 18.1.0
Upgrade github.com/evmos/evmos/v17 to 18.1.0
Upgrade github.com/evmos/evmos/v16 to 18.1.0
Upgrade github.com/evmos/evmos/v15 to 18.1.0
Upgrade github.com/evmos/evmos/v14 to 18.1.0
Upgrade github.com/evmos/evmos/v13 to 18.1.0
Upgrade github.com/evmos/evmos/v12 to 18.1.0
Upgrade github.com/evmos/evmos/v11 to 18.1.0
Upgrade github.com/evmos/evmos/v10 to 18.1.0
Upgrade github.com/evmos/evmos/v9 to 18.1.0
Upgrade github.com/evmos/evmos/v8 to 18.1.0
Upgrade github.com/evmos/evmos/v7 to 18.1.0
Upgrade github.com/evmos/evmos/v6 to 18.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/evmos/evmos/v18
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-37153, inspect your project dependencies for Github.com/evmos/evmos/v18:
inspect dependencies for github.com/evmos/evmos/v18
Analyze the terminal output to locate any version of Github.com/evmos/evmos/v18 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 18.1.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-670: Always-Incorrect Control Flow Implementation, where the code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated. In Github.com/evmos/evmos/v18, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-37153 Affected Github.com/evmos/evmos/v18 Versions
13 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/evmos/evmos/v18
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v17
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v16
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v15
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v14
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v13
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v12
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v11
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v10
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v9
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v8
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v7
|
Go |
< 18.1.0
|
18.1.0
|
|
github.com/evmos/evmos/v6
|
Go |
< 18.1.0
|
18.1.0
|
References
Frequently Asked Questions
What is CVE-2024-37153?
Which Github.com/evmos/evmos/v18 versions are affected?
What version fixes CVE-2024-37153?
Is github.com/evmos/evmos/v18 affected?
Is github.com/evmos/evmos/v17 affected?
What is the CVSS score of CVE-2024-37153?
What CWE is associated with CVE-2024-37153?
How can I check Go dependencies for CVE-2024-37153?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xgr7-jgq3-mhmc",
"modified" : "2024-06-17T15:23:41Z",
"published" : "2024-06-06T18:51:25Z",
"aliases" : [ "CVE-2024-37153" ],
"summary" : "Contract balance not updating correctly after interchain transaction",
"details" : "### Summary\n_Short summary of the problem. Make the impact and severity as clear as possible. For example: An unsafe deserialization vulnerability allows any unauthenticated user to execute arbitrary code on the server._\n\n### Details\nWe discovered a bug walking through how to liquid stake using Safe which itself is a contract. The bug only appears when there is a local state change together with an ICS20 transfer in the same function and uses the contract's balance, that is using the contract address as the `sender` parameter in an ICS20 transfer using the ICS20 precompile\n\n### Proof of Concept\n```solidity\n// This function does not reduce the contract balance correctly but liquid stakes correctly \nfunction transfer(\n string memory sourcePort,\n string memory sourceChannel,\n string memory denom,\n uint256 amount,\n string memory receiver,\n string memory evmosReceiver\n ) external returns (uint64 nextSequence) {\n counter += 1; # Only happens when there is a local state update together with an ICS20 Transfer\n Height memory timeoutHeight = Height(100, 100);\n string memory memo = buildLiquidStakeMemo(receiver, evmosReceiver);\n return ICS20_CONTRACT.transfer(\n sourcePort, \n sourceChannel,\n denom,\n amount,\n address(this), # this is the sender address which is the contract\n receiver,\n timeoutHeight,\n 0,\n memo\n );\n }\n```\n\n### Impact\nThis is in essence the \"infinite money glitch\" allowing contracts to double the supply of Evmos after each transaction.\n\n### Severity\n\nBased on [ImmuneFi Severity Classification System](https://immunefisupport.zendesk.com/hc/en-us/articles/13332717597585-Severity-Classification-System) the severity was evaluated to `Critical` since the attack could have lead to create new supply of EVMOS and therefore lead to Direct loss of funds's value.\n\n### Patches\n\nThe issue has been patched in versions >=V18.1.0. \n\n## For more information\nIf you have any questions or comments about this advisory:\n\nReach out to the Core Team in [Discord](https://discord.gg/evmos)\nOpen a discussion in [evmos/evmos](https://github.com/evmos/evmos/discussions)\nEmail us at [security@evmos.org](mailto:security@evmos.org) for security questions\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v18"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 18.0.0"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v17"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 17.0.1"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v16"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 16.0.4"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v15"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 15.0.0"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v14"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 14.1.0"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v13"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 13.0.2"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v12"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 12.1.6"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v11"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 11.0.2"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v10"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 10.0.1"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v9"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 9.1.0"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v8"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 8.2.3"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v7"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 7.0.0"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/evmos/evmos/v6"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "18.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 6.0.4"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/evmos/evmos/security/advisories/GHSA-xgr7-jgq3-mhmc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37153"
}, {
"type" : "WEB",
"url" : "https://github.com/evmos/evmos/commit/478b7a62e7af57a70cf3a01126c7f5a89bee69d7"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/evmos/evmos"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2024-2903"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-670" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-06T18:51:25Z",
"nvd_published_at" : "2024-06-06T19:15:58Z"
}
}