Vulnerabilities in pkg:golang/github.com/cosmos/interchain-security/v2

PACKAGE
Advisory Summary

GHSA-7q74-g774-7x3g is a HIGH the signers of ics messages vulnerability (General Security Weakness) affecting Interchain Security libraries in the Go ecosystem. The issue involves the signers of ics messages do not need to match the provider address. Remediation is available by upgrading affected packages to version 5.2.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/cosmos/interchain-security/v2

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/cosmos/interchain-security/v2. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7q74-g774-7x3g - HIGH Interchain Security: The signers of ICS messages do not need to match the provider address

GHSA-7q74-g774-7x3g at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-7q74-g774-7x3g
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Interchain Security
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-7q74-g774-7x3g

To remediate this vulnerability, upgrade all affected Interchain Security 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/cosmos/interchain-security/v5 fixed: 5.2.0
Upgrade github.com/cosmos/interchain-security/v5 to 5.2.0
github.com/cosmos/interchain-security fixed: Latest secure release
Upgrade github.com/cosmos/interchain-security to Latest secure release
github.com/cosmos/interchain-security/v2 fixed: Latest secure release
Upgrade github.com/cosmos/interchain-security/v2 to Latest secure release
github.com/cosmos/interchain-security/v3 fixed: Latest secure release
Upgrade github.com/cosmos/interchain-security/v3 to Latest secure release
github.com/cosmos/interchain-security/v4 fixed: Latest secure release
Upgrade github.com/cosmos/interchain-security/v4 to Latest secure release
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/cosmos/interchain-security/v5

How to Check if You Are Affected

To determine whether your application is affected by GHSA-7q74-g774-7x3g, inspect your project dependencies for Interchain Security:

inspect dependencies for github.com/cosmos/interchain-security/v5

Analyze the terminal output to locate any version of Interchain Security in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.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 General Security Weakness. In Interchain Security, 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

### Context ICS has the following four messages that enable validators on the provider chain to perform different actions: - `MsgOptIn` -- adds a validator to the consumer chain’s active set - `MsgOptOut` -- removes a validator from the consumer chain’s active set - `MsgAssignConsumerKey` -- changes the consensus key used for a validator’s operations on a consumer chain - `MsgSetConsumerCommissionRate` -- sets a validator’s consumer-specific commission rate Normally, only the respective validators are allowed to perform these actions. ### Issue The upgrade to SDK 0.50, introduced a [signer](https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations#signer) field to these messages. This field is used to authenticate the user sending the message to the system. However, there was no validation on the ICS side to check if the signer matches the provider address. As a result, any user could opt-in, opt-out, change the commission rate, or change what public key a validator uses on a consumer chain. For more context, check out the code: - proto files https://github.com/cosmos/interchain-security/blob/v5.1.1/proto/interchain_security/ccv/provider/v1/tx.proto#L52 - message validation https://github.com/cosmos/interchain-security/blob/v5.1.1/x/ccv/provider/types/msg.go#L106 - message handling https://github.com/cosmos/interchain-security/blob/v5.1.1/x/ccv/provider/keeper/msg_server.go#L52 ### Severity assessment The severity assessment is based on [this framework](https://github.com/interchainio/security/blob/main/resources/CLASSIFICATION_MATRIX.md). **Potential impact:** Catastrophic - By changing consumer keys for 1/3+ of a consumer chain's validator set, any user could cause a consumer chain to halt. Given that the consumer is down, the provider will jail provider validators for consumer downtime, so this exploit would not have impacted the provider directly. Consumer chain halts would need to be addressed by a provider-side patch. - By changing consumer keys on a consumer node, double signing, and submitting evidence back to the provider, any user could tombstone any provider validator. This would cause the provider's active set to change. At scale, this exploit could be applied to all active provider validators and a well-funded attacker could then run their own nodes and take over consensus on the provider and on consumer chains. **Likelihood:** Rare - The bug was discovered internally. There is no evidence that any external party has identified this vulnerability. - The bug has been live for two weeks with no issues. - All four message types are ones that only validators use, and rarely use in daily operations. - In the Cosmos Hub’s recent history (May - Aug), there has been only one instance of any of these message types, which was performed in accordance with chain rules. - The catastrophic exploits (such as tombstoning the entire validator set of the provider) are also extremely complex. They involve several operations that are not well-understood by many people, and the entire exploit must occur quickly and at-scale to avoid other node operators responding defensively.

GHSA-7q74-g774-7x3g Affected Interchain Security Versions

5 component(s)
Fixed Versions:
5.2.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cosmos/interchain-security/v5
Go
≥ 5.1.0
< 5.2.0
5.2.0
github.com/cosmos/interchain-security
Go
github.com/cosmos/interchain-security/v2
Go
github.com/cosmos/interchain-security/v3
Go
github.com/cosmos/interchain-security/v4
Go

References

Frequently Asked Questions

What is GHSA-7q74-g774-7x3g?
GHSA-7q74-g774-7x3g is a security vulnerability in Interchain Security involving The signers of ICS messages do not need to match the provider address under General Security Weakness.
Which Interchain Security versions are affected?
Affected versions include releases prior to 5.2.0 across affected packages: github.com/cosmos/interchain-security/v5, github.com/cosmos/interchain-security, github.com/cosmos/interchain-security/v2, github.com/cosmos/interchain-security/v3, github.com/cosmos/interchain-security/v4.
What version fixes GHSA-7q74-g774-7x3g?
Upgrading to 5.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cosmos/interchain-security/v5 affected?
Yes, github.com/cosmos/interchain-security/v5 is affected in releases prior to 5.2.0. Upgrade your dependency to 5.2.0 or later.
Is github.com/cosmos/interchain-security affected?
Yes, github.com/cosmos/interchain-security is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-7q74-g774-7x3g?
GHSA-7q74-g774-7x3g is classified under General Security Weakness.
How can I check Go dependencies for GHSA-7q74-g774-7x3g?
Run the dependency tree command: 'inspect dependencies for github.com/cosmos/interchain-security/v5'. 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-7q74-g774-7x3g",
  "modified" : "2024-09-06T21:41:48Z",
  "published" : "2024-09-05T21:19:36Z",
  "aliases" : [ ],
  "summary" : "Interchain Security: The signers of ICS messages do not need to match the provider address ",
  "details" : "### Context\n\nICS has the following four messages that enable validators on the provider chain to perform different actions:\n\n- `MsgOptIn` -- adds a validator to the consumer chain’s active set\n- `MsgOptOut` -- removes a validator from the consumer chain’s active set \n- `MsgAssignConsumerKey` -- changes the consensus key used for a validator’s operations on a consumer chain\n- `MsgSetConsumerCommissionRate` -- sets a validator’s consumer-specific commission rate\n\nNormally, only the respective validators are allowed to perform these actions. \n\n### Issue\n\nThe upgrade to SDK 0.50, introduced a [signer](https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations#signer) field to these messages. This field is used to authenticate the user sending the message to the system. However, there was no validation on the ICS side to check if the signer matches the provider address.  \n\nAs a result, any user could opt-in, opt-out, change the commission rate, or change what public key a validator uses on a consumer chain. \n\nFor more context, check out the code:\n\n- proto files https://github.com/cosmos/interchain-security/blob/v5.1.1/proto/interchain_security/ccv/provider/v1/tx.proto#L52\n- message validation https://github.com/cosmos/interchain-security/blob/v5.1.1/x/ccv/provider/types/msg.go#L106\n- message handling https://github.com/cosmos/interchain-security/blob/v5.1.1/x/ccv/provider/keeper/msg_server.go#L52\n\n### Severity assessment\n\nThe severity assessment is based on [this framework](https://github.com/interchainio/security/blob/main/resources/CLASSIFICATION_MATRIX.md). \n\n**Potential impact:** Catastrophic \n\n- By changing consumer keys for 1/3+ of a consumer chain's validator set, any user could cause a consumer chain to halt. Given that the consumer is down, the provider will jail provider validators for consumer downtime, so this exploit would not have impacted the provider directly. Consumer chain halts would need to be addressed by a provider-side patch.\n- By changing consumer keys on a consumer node, double signing, and submitting evidence back to the provider, any user could tombstone any provider validator. This would cause the provider's active set to change. At scale, this exploit could be applied to all active provider validators and a well-funded attacker could then run their own nodes and take over consensus on the provider and on consumer chains.\n\n**Likelihood:** Rare\n\n- The bug was discovered internally. There is no evidence that any external party has identified this vulnerability. \n- The bug has been live for two weeks with no issues. \n- All four message types are ones that only validators use, and rarely use in daily operations.\n- In the Cosmos Hub’s recent history (May - Aug), there has been only one instance of any of these message types, which was performed in accordance with chain rules.\n- The catastrophic exploits (such as tombstoning the entire validator set of the provider) are also extremely complex. They involve several operations that are not well-understood by many people, and the entire exploit must occur quickly and at-scale to avoid other node operators responding defensively.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cosmos/interchain-security/v5"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.1.0"
      }, {
        "fixed" : "5.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cosmos/interchain-security"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cosmos/interchain-security/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cosmos/interchain-security/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cosmos/interchain-security/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cosmos/interchain-security/security/advisories/GHSA-7q74-g774-7x3g"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cosmos/interchain-security"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-05T21:19:36Z",
    "nvd_published_at" : null
  }
}