Vulnerabilities in pkg:golang/github.com/spacemeshos/go-spacemesh

PACKAGE
Advisory Identifier: GHSA-jcqq-g64v-gcm7
Advisory Summary

CVE-2024-34360 is a HIGH (CVSS 8.2) previous atx is not checked vulnerability (CWE-754: Improper Check for Unusual or Exceptional Conditions) affecting Github.com/spacemeshos/go spacemesh libraries in the Go ecosystem. The issue involves previous atx is not checked to be the newest valid atx by smesher when validating incoming atx. Remediation is available by upgrading affected packages to version 1.5.2-hotfix1, 1.37.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/spacemeshos/go-spacemesh

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/spacemeshos/go-spacemesh. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-jcqq-g64v-gcm7 CVE-2024-34360 HIGH Previous ATX is not checked to be the newest valid ATX by Smesher when validating incoming ATX

CVE-2024-34360 at a Glance

CVE Identifier CVE-2024-34360
GHSA Identifier GHSA-jcqq-g64v-gcm7
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-754: Improper Check for Unusual or Exceptional Conditions
Affected Product Github.com/spacemeshos/go spacemesh
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.2

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

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 High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-34360

To remediate this vulnerability, upgrade all affected Github.com/spacemeshos/go spacemesh 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/spacemeshos/go-spacemesh fixed: 1.5.2-hotfix1
Upgrade github.com/spacemeshos/go-spacemesh to 1.5.2-hotfix1
github.com/spacemeshos/api fixed: 1.37.1
Upgrade github.com/spacemeshos/api to 1.37.1
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/spacemeshos/go-spacemesh

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-34360, inspect your project dependencies for Github.com/spacemeshos/go spacemesh:

inspect dependencies for github.com/spacemeshos/go-spacemesh

Analyze the terminal output to locate any version of Github.com/spacemeshos/go spacemesh in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.2-hotfix1), 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-754: Improper Check for Unusual or Exceptional Conditions, where the product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product. In Github.com/spacemeshos/go spacemesh, 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 Nodes can publish ATXs which reference the incorrect previous ATX of the Smesher that created the ATX. ATXs are expected to form a single chain from the newest to the first ATX ever published by an identity. Allowing Smeshers to reference an earlier (but not the latest) ATX as previous breaks this protocol rule and can serve as an attack vector where Nodes are rewarded for holding their PoST data for less than one epoch but still being eligible for rewards. ### Patches - API needs to be extended to be able to fetch events from a node that dected malicious behavior of this regard by the node - go-spacemesh needs to be patched to a) not allow publishing these ATXs any more and b) create malfeasance proofs for identities that published invalid ATXs in the past. ### Workarounds n/a ### References Spacemesh protocol whitepaper: https://spacemesh.io/blog/spacemesh-white-paper-1/, specifically sections 4.4.2 ("ATX Contents") and 4.4.3 ("ATX validity")

CVE-2024-34360 Affected Github.com/spacemeshos/go spacemesh Versions

2 component(s)
Fixed Versions:
1.5.2-hotfix11.37.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/spacemeshos/go-spacemesh
Go
< 1.5.2-hotfix1
1.5.2-hotfix1
github.com/spacemeshos/api
Go
< 1.37.1
1.37.1

References

Frequently Asked Questions

What is CVE-2024-34360?
CVE-2024-34360 is a security vulnerability in Github.com/spacemeshos/go spacemesh involving Previous ATX is not checked to be the newest valid ATX by Smesher when validating incoming ATX under CWE-754: Improper Check for Unusual or Exceptional Conditions.
Which Github.com/spacemeshos/go spacemesh versions are affected?
Affected versions include releases prior to 1.5.2-hotfix1, 1.37.1 across affected packages: github.com/spacemeshos/go-spacemesh, github.com/spacemeshos/api.
What version fixes CVE-2024-34360?
Upgrading to 1.5.2-hotfix1, 1.37.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/spacemeshos/go-spacemesh affected?
Yes, github.com/spacemeshos/go-spacemesh is affected in releases prior to 1.5.2-hotfix1. Upgrade your dependency to 1.5.2-hotfix1 or later.
Is github.com/spacemeshos/api affected?
Yes, github.com/spacemeshos/api is affected in releases prior to 1.37.1. Upgrade your dependency to 1.37.1 or later.
What is the CVSS score of CVE-2024-34360?
CVE-2024-34360 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2024-34360?
CVE-2024-34360 is classified under CWE-754: Improper Check for Unusual or Exceptional Conditions (The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.).
How can I check Go dependencies for CVE-2024-34360?
Run the dependency tree command: 'inspect dependencies for github.com/spacemeshos/go-spacemesh'. 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-jcqq-g64v-gcm7",
  "modified" : "2024-05-14T19:54:27Z",
  "published" : "2024-05-10T15:33:40Z",
  "aliases" : [ "CVE-2024-34360" ],
  "summary" : "Previous ATX is not checked to be the newest valid ATX by Smesher when validating incoming ATX",
  "details" : "### Impact\nNodes can publish ATXs which reference the incorrect previous ATX of the Smesher that created the ATX. ATXs are expected to form a single chain from the newest to the first ATX ever published by an identity. Allowing Smeshers to reference an earlier (but not the latest) ATX as previous breaks this protocol rule and can serve as an attack vector where Nodes are rewarded for holding their PoST data for less than one epoch but still being eligible for rewards.\n\n### Patches\n- API needs to be extended to be able to fetch events from a node that dected malicious behavior of this regard by the node\n- go-spacemesh needs to be patched to a) not allow publishing these ATXs any more and b) create malfeasance proofs for identities that published invalid ATXs in the past.\n\n### Workarounds\nn/a\n\n### References\nSpacemesh protocol whitepaper: https://spacemesh.io/blog/spacemesh-white-paper-1/, specifically sections 4.4.2 (\"ATX Contents\") and 4.4.3 (\"ATX validity\")",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/spacemeshos/go-spacemesh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.2-hotfix1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/spacemeshos/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.37.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/spacemeshos/go-spacemesh/security/advisories/GHSA-jcqq-g64v-gcm7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-34360"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spacemeshos/api/commit/1d5bd972bbe225d024c3e0ae5214ddb6b481716e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spacemeshos/go-spacemesh/commit/9aff88d54be809ac43d60e8a8b4d65359c356b87"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spacemeshos/go-spacemesh"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-2831"
  }, {
    "type" : "WEB",
    "url" : "https://spacemesh.io/blog/spacemesh-white-paper-1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-754" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-10T15:33:40Z",
    "nvd_published_at" : "2024-05-14T15:38:45Z"
  }
}