GHSA-2557-x9mg-76w8: ASA-2024-002 Default `PrepareProposalHandler` May Produce Invalid Vulnerability

MODERATE
CVSS 5.3
CWE-1285
Published
Advisory Summary

GHSA-2557-x9mg-76w8 is a MODERATE (CVSS 5.3) default `prepareproposalhandler` may produce invalid vulnerability (CWE-1285: Improper Validation of Specified Index, Position, or Offset in Input) affecting ASA-2024-002 libraries in the Go ecosystem. The issue involves default `prepareproposalhandler` may produce invalid proposals when used with default `sendernoncemempool`. Remediation is available by upgrading affected packages to version 0.50.4, 0.47.9.

GHSA-2557-x9mg-76w8 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-2557-x9mg-76w8
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-1285: Improper Validation of Specified Index, Position, or Offset in Input
Affected Product ASA-2024-002
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:N/A:L).

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

How to Fix GHSA-2557-x9mg-76w8

To remediate this vulnerability, upgrade all affected ASA-2024-002 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: 0.50.4
Upgrade github.com/cosmos/cosmos-sdk to 0.50.4
github.com/cosmos/cosmos-sdk fixed: 0.47.9
Upgrade github.com/cosmos/cosmos-sdk to 0.47.9
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-2557-x9mg-76w8, inspect your project dependencies for ASA-2024-002:

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

Analyze the terminal output to locate any version of ASA-2024-002 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.50.4), 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-1285: Improper Validation of Specified Index, Position, or Offset in Input, where the product receives input that is expected to specify an index, position, or offset into an indexable resource such as a buffer or file, but it does not validate or incorrectly validates that the specified index/position/offset has the required properties. In ASA-2024-002, 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

## ASA-2024-002: Default `PrepareProposalHandler` may produce invalid proposals when used with default `SenderNonceMempool` **Component**: Cosmos SDK **Criticality**: Medium **Affected** Versions: Cosmos SDK versions <= 0.50.3; <= 0.47.8 **Affected** Users: Chain developers, Validator and Node operators **Impact**: Denial of Service ## Summary When using the default `PrepareProposalHandler` and the default `SenderNonceMempool`, an issue was identified which may allow invalid blocks to be proposed when a single sender includes multiple transactions with non-sequential sequence numbers in certain conditions. If this state is reached, it can lead to a reduction in block production for a network. ## Next Steps for Impacted Parties If you are a chain developer on an affected version of the Cosmos SDK, it is advised to update to the latest available version of the Cosmos SDK for your project. Once a patched version is available, it is recommended that network operators upgrade. A Github Security Advisory for this issue is available in the Cosmos-SDK [repository](https://github.com/cosmos/cosmos-sdk/security/advisories). For more information about Cosmos SDK, see https://docs.cosmos.network/. This issue was found by [KonradStaniec](https://github.com/KonradStaniec), [gitferry](https://github.com/gitferry), [SebastianElvis](https://github.com/SebastianElvis), and [vitsalis](https://github.com/vitsalis) who reported it to the Cosmos Bug Bounty Program on HackerOne on January 16, 2024. If you believe you have found a bug in the Interchain Stack or would like to contribute to the program by reporting a bug, please see https://hackerone.com/cosmos.

GHSA-2557-x9mg-76w8 Affected ASA-2024-002 Versions

2 component(s)
Fixed Versions:
0.50.40.47.9
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cosmos/cosmos-sdk
Go
≥ 0.50.0
< 0.50.4
0.50.4
github.com/cosmos/cosmos-sdk
Go
< 0.47.9
0.47.9

References

Frequently Asked Questions

What is GHSA-2557-x9mg-76w8?
GHSA-2557-x9mg-76w8 is a security vulnerability in ASA-2024-002 involving Default `PrepareProposalHandler` may produce invalid proposals when used with default `SenderNonceMempool` under CWE-1285: Improper Validation of Specified Index, Position, or Offset in Input.
Which ASA-2024-002 versions are affected?
Affected versions include releases prior to 0.50.4, 0.47.9 across affected packages: github.com/cosmos/cosmos-sdk.
What version fixes GHSA-2557-x9mg-76w8?
Upgrading to 0.50.4, 0.47.9 (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 0.50.4, 0.47.9. Upgrade your dependency to 0.50.4, 0.47.9 or later.
What is the CVSS score of GHSA-2557-x9mg-76w8?
GHSA-2557-x9mg-76w8 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with GHSA-2557-x9mg-76w8?
GHSA-2557-x9mg-76w8 is classified under CWE-1285: Improper Validation of Specified Index, Position, or Offset in Input (The product receives input that is expected to specify an index, position, or offset into an indexable resource such as a buffer or file, but it does not validate or incorrectly validates that the specified index/position/offset has the required properties.).
How can I check Go dependencies for GHSA-2557-x9mg-76w8?
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-2557-x9mg-76w8",
  "modified" : "2024-05-23T18:32:11Z",
  "published" : "2024-02-21T00:13:46Z",
  "aliases" : [ ],
  "summary" : "ASA-2024-002: Default `PrepareProposalHandler` may produce invalid proposals when used with default `SenderNonceMempool`",
  "details" : "## ASA-2024-002: Default `PrepareProposalHandler` may produce invalid proposals when used with default `SenderNonceMempool`\n\n**Component**: Cosmos SDK\n**Criticality**: Medium\n**Affected** Versions: Cosmos SDK versions <= 0.50.3; <= 0.47.8\n**Affected** Users: Chain developers, Validator and Node operators\n**Impact**: Denial of Service\n\n## Summary\n\nWhen using the default `PrepareProposalHandler` and the default `SenderNonceMempool`, an issue was identified which may allow invalid blocks to be proposed when a single sender includes multiple transactions with non-sequential sequence numbers in certain conditions. If this state is reached, it can lead to a reduction in block production for a network.\n\n## Next Steps for Impacted Parties\n\nIf you are a chain developer on an affected version of the Cosmos SDK, it is advised to update to the latest available version of the Cosmos SDK for your project.  Once a patched version is available, it is recommended that network operators upgrade.\n\nA Github Security Advisory for this issue is available in the Cosmos-SDK [repository](https://github.com/cosmos/cosmos-sdk/security/advisories). For more information about Cosmos SDK, see https://docs.cosmos.network/.\n\nThis issue was found by [KonradStaniec](https://github.com/KonradStaniec), [gitferry](https://github.com/gitferry), [SebastianElvis](https://github.com/SebastianElvis), and [vitsalis](https://github.com/vitsalis) who reported it to the Cosmos Bug Bounty Program on HackerOne on January 16, 2024. If you believe you have found a bug in the Interchain Stack or would like to contribute to the program by reporting a bug, please see https://hackerone.com/cosmos.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cosmos/cosmos-sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.50.0"
      }, {
        "fixed" : "0.50.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.50.3"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cosmos/cosmos-sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.47.9"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.47.8"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-2557-x9mg-76w8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cosmos/cosmos-sdk/commit/c05850241e2d615721e3492d15fee4e1deec082b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cosmos/cosmos-sdk/commit/fe32bcc1d65412c9b5737672956f0638c729ab7d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cosmos/cosmos-sdk"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1285" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-21T00:13:46Z",
    "nvd_published_at" : null
  }
}