CVE-2024-32873: Github.com/evmos/evmos/v17 Evmos Allows Transferring Unvested Tokens Vulnerability

LOW
Advisory Identifier: GHSA-pxv8-qhrh-jc7v
CVSS 3.5
CWE-682
Published
Advisory Summary

CVE-2024-32873 is a LOW (CVSS 3.5) evmos allows transferring unvested tokens vulnerability (CWE-682: Incorrect Calculation) affecting Github.com/evmos/evmos/v17 libraries in the Go ecosystem. The issue involves evmos allows transferring unvested tokens after delegations. Remediation is available by upgrading affected packages to version 18.0.0.

CVE-2024-32873 at a Glance

CVE Identifier CVE-2024-32873
GHSA Identifier GHSA-pxv8-qhrh-jc7v
Severity LOW
CVSS v3.1 Base Score 3.5
CWE Classification CWE-682: Incorrect Calculation
Affected Product Github.com/evmos/evmos/v17
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 3.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-32873

To remediate this vulnerability, upgrade all affected Github.com/evmos/evmos/v17 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/evmos/evmos/v17 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v17 to 18.0.0
github.com/evmos/evmos/v16 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v16 to 18.0.0
github.com/evmos/evmos/v15 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v15 to 18.0.0
github.com/evmos/evmos/v14 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v14 to 18.0.0
github.com/evmos/evmos/v13 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v13 to 18.0.0
github.com/evmos/evmos/v12 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v12 to 18.0.0
github.com/evmos/evmos/v11 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v11 to 18.0.0
github.com/evmos/evmos/v10 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v10 to 18.0.0
github.com/evmos/evmos/v9 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v9 to 18.0.0
github.com/evmos/evmos/v8 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v8 to 18.0.0
github.com/evmos/evmos/v7 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v7 to 18.0.0
github.com/evmos/evmos/v6 fixed: 18.0.0
Upgrade github.com/evmos/evmos/v6 to 18.0.0
Verify Direct and Transitive Dependencies

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/v17

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-32873, inspect your project dependencies for Github.com/evmos/evmos/v17:

inspect dependencies for github.com/evmos/evmos/v17

Analyze the terminal output to locate any version of Github.com/evmos/evmos/v17 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 18.0.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-682: Incorrect Calculation, where the product performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management. In Github.com/evmos/evmos/v17, 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

## Impact This advisory has been created to address the following vulnerabilities found in the Evmos codebase and affecting vesting accounts. ### Wrong spendable balance computation The spendable balance is not updated properly when delegating vested tokens. The following example help in describing the issue: - Given a clawback vesting account with a starting `15M` vesting schedule. The initial spendable balance is `0`. - Time passes and `5M` are vested. The spendable balance is now `5M`. - The account delegate `5M`. The spendable balance should be `0`, but returns `5M` - The account can send `5M` to another account. The issue allowed a clawback vesting account to anticipate the release of unvested tokens. ### Missing precompile checks Preliminary checks on actions computed by the clawback vesting accounts are performed in the ante handler. Evmos core, implements two different ante handlers: one for Cosmos transactions and one for Ethereum transactions. Checks performed on the two implementation are different. The vulnerability discovered allowed a clawback account to bypass Cosmos ante handler checks by sending an Ethereum transaction targeting a precompile used to interact with a Cosmos SDK module. ### Missing create validator check This vulnerability allowed a user to create a validator using vested tokens to deposit the self-bond. ## Patches - The spendable balance function has been fixed correcting the `TrackDelegation` function. - The checks for the staking module, for the delegation and the create validator, has been moved into the `MsgServer` of a wrapper around the Cosmos SDK staking module. The issues have been patched in versions >=V18.0.0. ## References 1. [Evmos vesting module](https://docs.evmos.org/protocol/modules/vesting) ## For more information If you have any questions or comments about this advisory: Reach out to the Core Team in [Discord](https://discord.gg/evmos) Open a discussion in [evmos/evmos](https://github.com/evmos/evmos/discussions) Email us at [security@evmos.org](mailto:security@evmos.org) for security questions

CVE-2024-32873 Affected Github.com/evmos/evmos/v17 Versions

12 component(s)
Fixed Versions:
18.0.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/evmos/evmos/v17
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v16
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v15
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v14
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v13
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v12
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v11
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v10
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v9
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v8
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v7
Go
< 18.0.0
18.0.0
github.com/evmos/evmos/v6
Go
< 18.0.0
18.0.0

References

Frequently Asked Questions

What is CVE-2024-32873?
CVE-2024-32873 is a security vulnerability in Github.com/evmos/evmos/v17 involving evmos allows transferring unvested tokens after delegations under CWE-682: Incorrect Calculation.
Which Github.com/evmos/evmos/v17 versions are affected?
Affected versions include releases prior to 18.0.0 across affected packages: github.com/evmos/evmos/v17, github.com/evmos/evmos/v16, github.com/evmos/evmos/v15, github.com/evmos/evmos/v14, github.com/evmos/evmos/v13, github.com/evmos/evmos/v12, github.com/evmos/evmos/v11, github.com/evmos/evmos/v10, github.com/evmos/evmos/v9, github.com/evmos/evmos/v8, github.com/evmos/evmos/v7, github.com/evmos/evmos/v6.
What version fixes CVE-2024-32873?
Upgrading to 18.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/evmos/evmos/v17 affected?
Yes, github.com/evmos/evmos/v17 is affected in releases prior to 18.0.0. Upgrade your dependency to 18.0.0 or later.
Is github.com/evmos/evmos/v16 affected?
Yes, github.com/evmos/evmos/v16 is affected in releases prior to 18.0.0. Upgrade your dependency to 18.0.0 or later.
What is the CVSS score of CVE-2024-32873?
CVE-2024-32873 has a CVSS v3.1 base score of 3.5 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2024-32873?
CVE-2024-32873 is classified under CWE-682: Incorrect Calculation (The product performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management.).
How can I check Go dependencies for CVE-2024-32873?
Run the dependency tree command: 'inspect dependencies for github.com/evmos/evmos/v17'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pxv8-qhrh-jc7v",
  "modified" : "2024-09-06T21:40:06Z",
  "published" : "2024-06-06T18:21:05Z",
  "aliases" : [ "CVE-2024-32873" ],
  "summary" : "evmos allows transferring unvested tokens after delegations",
  "details" : "## Impact\n\nThis advisory has been created to address the following vulnerabilities found in the Evmos codebase and affecting vesting accounts.\n\n### Wrong spendable balance computation\n\nThe spendable balance is not updated properly when delegating vested tokens. The following example help in describing the issue:\n- Given a clawback vesting account with a starting `15M` vesting schedule. The initial spendable balance is `0`.\n- Time passes and `5M` are vested. The spendable balance is now `5M`.\n- The account delegate `5M`. The spendable balance should be `0`, but returns `5M`\n- The account can send `5M` to another account.\n\nThe issue allowed a clawback vesting account to anticipate the release of unvested tokens.\n\n### Missing precompile checks\n\nPreliminary checks on actions computed by the clawback vesting accounts are performed in the ante handler. Evmos core, implements two different ante handlers: one for Cosmos transactions and one for Ethereum transactions. Checks performed on the two implementation are different.\n\nThe vulnerability discovered allowed a clawback account to bypass Cosmos ante handler checks by sending an Ethereum transaction targeting a precompile used to interact with a Cosmos SDK module.\n\n### Missing create validator check\n\nThis vulnerability allowed a user to create a validator using vested tokens to deposit the self-bond.\n\n## Patches\n\n- The spendable balance function has been fixed correcting the `TrackDelegation` function.\n- The checks for the staking module, for the delegation and the create validator, has been moved into the `MsgServer` of a wrapper around the Cosmos SDK staking module. \n\nThe issues have been patched in versions >=V18.0.0.\n\n## References\n1. [Evmos vesting module](https://docs.evmos.org/protocol/modules/vesting)\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",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/evmos/evmos/v17"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "18.0.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.0.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.0.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.0.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.0.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.0.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.0.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.0.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.0.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.0.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.0.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.0.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/evmos/evmos/security/advisories/GHSA-pxv8-qhrh-jc7v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-32873"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37158"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37159"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/evmos/evmos/commit/b2a09ca66613d8b04decd3f2dcba8e1e77709dcb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/evmos/evmos"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-2891"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-682" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-06T18:21:05Z",
    "nvd_published_at" : "2024-06-06T19:15:56Z"
  }
}