GHSA-qfc5-6r3j-jj22: Github.com/cosmos/cosmos sdk Go Package Github.com/cosmos/cosmos-sdk Module X/crisis Vulnerability

LOW
Published
Advisory Summary

GHSA-qfc5-6r3j-jj22 is a LOW go package github.com/cosmos/cosmos-sdk module x/crisis vulnerability (General Security Weakness) affecting Github.com/cosmos/cosmos sdk libraries in the Go ecosystem. The issue involves go package github.com/cosmos/cosmos-sdk module x/crisis does not cause chain halt. Remediation is available in the latest vendor maintenance releases.

GHSA-qfc5-6r3j-jj22 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-qfc5-6r3j-jj22
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Github.com/cosmos/cosmos sdk
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-qfc5-6r3j-jj22

To remediate this vulnerability, upgrade all affected Github.com/cosmos/cosmos sdk 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/cosmos-sdk fixed: Latest secure release
Upgrade github.com/cosmos/cosmos-sdk 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/cosmos-sdk

How to Check if You Are Affected

To determine whether your application is affected by GHSA-qfc5-6r3j-jj22, inspect your project dependencies for Github.com/cosmos/cosmos sdk:

inspect dependencies for github.com/cosmos/cosmos-sdk

Analyze the terminal output to locate any version of Github.com/cosmos/cosmos sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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 Github.com/cosmos/cosmos sdk, 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

# x/crisis does NOT cause chain halt ### Impact If an invariant check fails on a Cosmos SDK network and a transaction is sent to the `x/crisis` module to halt the chain, the chain does not halt. All versions of the `x/crisis` module is affected on all versions of the Cosmos SDK. ### Details The `x/crisis` module is supposed to allow anyone to halt a chain in the event of a violated invariant by sending a `MsgVerifyInvariant` with the name of the invariant. Processing this message is supposed to cause the nodes to panic. However, because the panic is within a transaction, it is caught by the SDK’s built-in panic-recovery machinery and just treated as a normal “invalid” transaction (ie. it returns a non-zero abci Code). Thus the `x/crisis` transactions don’t actually cause chains to halt. If there is an invariant violation, it can be confirmed with an `x/crisis` transaction, but it won’t cause any nodes to halt, they will just continue processing blocks. That said, any node running with `start --inv-check-period X` will actually panic when it runs the periodic check (though it will still not panic just by processing an `x/crisis` transaction). Since this panic is located in EndBlock, it is not caught by the panic-recovery machinery and does actually crash the node. Presumably few if any nodes actually run with this in production because of how long the invariant checks take, and this runs all of them every `X` blocks. ### Patches No patches will be released. The `x/crisis` module was originally intended to allow chains to halt rather than continue with some unknown behaviour in the case of an invariant violation (safety over liveness). However, as chains mature, and especially as the potential [cost of halting increases](https://github.com/osmosis-labs/osmosis/issues/570), chains should consider carefully what invariants they really want to halt for, and what invariants are just sort of helpful sanity checks, but may not be worth halting for. In some cases, chains have already broken the invariant calculations but have dealt with the consequences off-chain or during development. Halting these chains would be counter-productive. The SDK team is working on new modules that allow chain developers to fine-tune the chain invariants and the necessary actions. Hence, the decision was made that the `x/crisis` module will not be patched for chain halts. The module will be deprecated when new modules take over its responsibilities. ### Workarounds In case of a valid invariant check failure that requires a chain halt, the network validators are encouraged to coordinate off-chain for network halts. This has been an already established process for security patches. ### References SDK developer epic about invariant checking: https://github.com/cosmos/cosmos-sdk/issues/15706 Public report: https://github.com/cosmos/cosmos-sdk/issues/15325

GHSA-qfc5-6r3j-jj22 Affected Github.com/cosmos/cosmos sdk Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cosmos/cosmos-sdk
Go
≤ 0.47.2

References

Frequently Asked Questions

What is GHSA-qfc5-6r3j-jj22?
GHSA-qfc5-6r3j-jj22 is a security vulnerability in Github.com/cosmos/cosmos sdk involving Go package github.com/cosmos/cosmos-sdk module x/crisis does NOT cause chain halt under General Security Weakness.
Which Github.com/cosmos/cosmos sdk versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/cosmos/cosmos-sdk.
What version fixes GHSA-qfc5-6r3j-jj22?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cosmos/cosmos-sdk affected?
Yes, github.com/cosmos/cosmos-sdk is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-qfc5-6r3j-jj22?
GHSA-qfc5-6r3j-jj22 is classified under General Security Weakness.
How can I check Go dependencies for GHSA-qfc5-6r3j-jj22?
Run the dependency tree command: 'inspect dependencies for github.com/cosmos/cosmos-sdk'. 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-qfc5-6r3j-jj22",
  "modified" : "2023-07-05T19:52:13Z",
  "published" : "2023-06-02T17:11:58Z",
  "aliases" : [ ],
  "summary" : "Go package github.com/cosmos/cosmos-sdk module x/crisis does NOT cause chain halt",
  "details" : "# x/crisis does NOT cause chain halt\n\n### Impact\nIf an invariant check fails on a Cosmos SDK network and a transaction is sent to the `x/crisis` module to halt the chain, the chain does not halt. All versions of the `x/crisis` module is affected on all versions of the Cosmos SDK.\n\n### Details\nThe `x/crisis` module is supposed to allow anyone to halt a chain in the event of a violated invariant by sending a `MsgVerifyInvariant` with the name of the invariant. Processing this message is supposed to cause the nodes to panic. However, because the panic is within a transaction, it is caught by the SDK’s built-in panic-recovery machinery and just treated as a normal “invalid” transaction (ie. it returns a non-zero abci Code). Thus the `x/crisis` transactions don’t actually cause chains to halt. If there is an invariant violation, it can be confirmed with an `x/crisis` transaction, but it won’t cause any nodes to halt, they will just continue processing blocks.\n\nThat said, any node running with `start --inv-check-period X` will actually panic when it runs the periodic check (though it will still not panic just by processing an `x/crisis` transaction). Since this panic is located in EndBlock, it is not caught by the panic-recovery machinery and does actually crash the node. Presumably few if any nodes actually run with this in production because of how long the invariant checks take, and this runs all of them every `X` blocks.\n\n### Patches\nNo patches will be released.\n\nThe `x/crisis` module was originally intended to allow chains to halt rather than continue with some unknown behaviour in the case of an invariant violation (safety over liveness). However, as chains mature, and especially as the potential [cost of halting increases](https://github.com/osmosis-labs/osmosis/issues/570), chains should consider carefully what invariants they really want to halt for, and what invariants are just sort of helpful sanity checks, but may not be worth halting for.\n\nIn some cases, chains have already broken the invariant calculations but have dealt with the consequences off-chain or during development. Halting these chains would be counter-productive.\n\nThe SDK team is working on new modules that allow chain developers to fine-tune the chain invariants and the necessary actions.\n\nHence, the decision was made that the `x/crisis` module will not be patched for chain halts. The module will be deprecated when new modules take over its responsibilities.\n\n### Workarounds\nIn case of a valid invariant check failure that requires a chain halt, the network validators are encouraged to coordinate off-chain for network halts. This has been an already established process for security patches.\n\n### References\nSDK developer epic about invariant checking: https://github.com/cosmos/cosmos-sdk/issues/15706\nPublic report: https://github.com/cosmos/cosmos-sdk/issues/15325",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cosmos/cosmos-sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.47.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-qfc5-6r3j-jj22"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cosmos/cosmos-sdk/issues/15325"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cosmos/cosmos-sdk/issues/15706"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cosmos/cosmos-sdk"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-02T17:11:58Z",
    "nvd_published_at" : null
  }
}