{"answers":{"affected":"11 open source packages ship an affected version, including github.com/cometbft/cometbft/light and github.com/cometbft/cometbft.","exploited":"There is no known exploitation of GHSA-g5xx-c4hv-9ccc in the wild and no public exploit code.","fix":"Upgrade github.com/cometbft/cometbft/light to a fixed version for your release line: 0.34.34, 0.37.11 or 0.38.12.","what":"GHSA-g5xx-c4hv-9ccc is a vulnerability in github.com/cometbft/cometbft, published on 3 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-g5xx-c4hv-9ccc and fix it if it is affected.\n\nWhat it is: GHSA-g5xx-c4hv-9ccc is a vulnerability in github.com/cometbft/cometbft, published on 3 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-g5xx-c4hv-9ccc in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/cometbft/cometbft/light (Go): affected from 0.34.0; fixed in 0.34.34\n- github.com/cometbft/cometbft/light (Go): affected from 0.34.0; fixed in 0.34.34\n- github.com/cometbft/cometbft/light (Go): affected from 0.37.0; fixed in 0.37.11\n- github.com/cometbft/cometbft/light (Go): affected from 0.37.0; fixed in 0.37.11\n- github.com/cometbft/cometbft/light (Go): affected from 0.38.0; fixed in 0.38.12\n- github.com/cometbft/cometbft/light (Go): affected from 0.38.0; fixed in 0.38.12\n- github.com/cometbft/cometbft (Go): affected from 0.37.0; fixed in 0.37.11, 0.38.12\n- github.com/cometbft/cometbft (Go): affected from 0.37.0; fixed in 0.37.11\n- github.com/cometbft/cometbft (Go): affected from 0.37.0; fixed in 0.37.11\n- github.com/cometbft/cometbft (Go): affected from 0.38.0; fixed in 0.38.12\n- github.com/cometbft/cometbft (Go): affected from 0.38.0; fixed in 0.38.12\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-g5xx-c4hv-9ccc/ (Markdown: https://insights.sbomify.com/GHSA-g5xx-c4hv-9ccc/index.md)","id":"GHSA-g5xx-c4hv-9ccc","markdown":"https://insights.sbomify.com/GHSA-g5xx-c4hv-9ccc/index.md","name":"GHSA-g5xx-c4hv-9ccc","record":{"aliases":["GO-2024-3112"],"analysis":{"component_type":"server_software","fix_type":"upgrade","impacts":["denial_of_service","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"CometBFT consensus","requires_auth":"none","summary":"A malicious RPC endpoint can provide invalid proposer priorities during state sync, causing validators to disagree on consensus and potentially leading to a chain split.","user_interaction":"not_required","vuln_class":"business_logic"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"**Name**: ASA-2024-009: State syncing validator from malicious node may lead to a chain split\n**Component**: CometBFT\n**Criticality**: Medium ([ACMv1.2](https://github.com/interchainio/security/blob/main/resources/CLASSIFICATION_MATRIX.md): I:Moderate; L: Possible)\n**Affected versions**: \u003e= 0.34.0, \u003c= 0.34.33, \u003e=0.37.0, \u003c= 0.37.10, \u003e= 0.38.0, \u003c= 0.38.11\n\n### Summary\n\nThe state sync protocol retrieves a snapshot of the application and installs it in a fresh node. In order for this node to be ready to run consensus and block sync from the installed snapshot height, we also need to install a valid `State` in the node, which is the starting state from which it is able to validate new blocks and append them to the blockchain.\n\nThe `State` object used by state sync is computed using the light client protocol, which retrieves information about committed blocks from at least two RPC endpoints. The light client protocol performs several state validations and, in particular, compares the state provided by different RPC endpoints, looking for inconsistencies.\n\nThe `State` object contains, among other fields, a `Validators` field which stores the current validator set. A validator set is a list of validator addresses, public keys and associated voting powers, one per validator. It also stores, for historical reasons, the state of the proposer selection algorithm, in the form of the `ProposerPriority` field associated with each `Validator`.\n\nWhile the light client is able to validate the `ValidatorSet` retrieved from RPC endpoints, this validation does not include the `ProposerPriority` field associated with each `Validator`. As a result, when state sync adopts RPC endpoints that, for unknown reasons, provide an invalid state of the proposer selection algorithm, the node will not be able to properly run the consensus protocol, as their local view of which validator is the proposer of a given round and height will disagree with the views of the correct validators. If an increasing number of validators state sync using RPC endpoints with invalid states, the network eventually halts.\n\n### Patches\n\nRelease versions 0.34.34, 0.37.11, and 0.38.12 include a patch to address this issue.\n\nIn the patched versions, the light client protocol compares the `ProposerPriority` fields of the `ValidatorSet` instances retrieved from the RPC endpoints configured for state sync. If they differ, the computed `State` object is considered invalid and state sync will fail with an error.\n\n### Workarounds\n\nThe issue is observed when validators run state sync using RPC nodes that are malicious or report invalid states for the proposer selection algorithm.\n\nIt is worth noting that non-malicious nodes running upstream software should never report an invalid state for the proposer selection algorithm. This situation may result from the adoption of nodes with customized code or which had their state, stored in local databases, manually updated.\n\nWhen the network public's RPC endpoints have an invalid state for the proposer election algorithm, there, new validators should refrain from using state sync for bootstrapping or be sure that they configure for state sync RPC endpoints with a valid state of the proposer election algorithm.\n\nA validator with an invalid state for the proposer selection algorithm will reject most of the proposed blocks and will have the network rejecting blocks it has proposed.  It is also possible to manually compare the state of the proposer election algorithm of nodes by comparing the outputs of the `/validators?height=_`  RPC endpoints. The outputs must fully match, including the ProposerPriority field associated with each validator. \n\n### References\n\n* [State Sync documentation](https://docs.cometbft.com/v0.38/core/state-sync)\n\nThis issue was reported to the Cosmos Bug Bounty Program on HackerOne on 12/08/24. 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](https://hackerone.com/cosmos).\n\nIf you have questions about Interchain security efforts, please reach out to our official communication channel at [security@interchain.io](mailto:security@interchain.io).\n\nFor more information about CometBFT, please see [https://docs.cometbft.com/](https://docs.cometbft.com/).\n\nFor more information about the Interchain Foundation’s engagement with Amulet, please see [https://github.com/interchainio/security](https://github.com/interchainio/security).","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"CometBFT's state syncing validator from malicious node may lead to a chain split","id":"GHSA-g5xx-c4hv-9ccc","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"business_logic","year":"2024"},"n_packages":11,"n_references":null,"packages":[{"ecosystem":"Go","fixed":["0.37.11","0.38.12"],"introduced":["0.37.0","0.38.0"],"last_affected":[],"package":"github.com/cometbft/cometbft","purl":"pkg:golang/github.com/cometbft/cometbft","source":"GO-2024-3112"},{"ecosystem":"Go","fixed":["0.37.11"],"introduced":["0.37.0"],"last_affected":[],"package":"github.com/cometbft/cometbft","purl":null,"source":"GHSA-g5xx-c4hv-9ccc"},{"ecosystem":"Go","fixed":["0.37.11"],"introduced":["0.37.0"],"last_affected":[],"package":"github.com/cometbft/cometbft","purl":"pkg:golang/github.com/cometbft/cometbft","source":"GHSA-g5xx-c4hv-9ccc"},{"ecosystem":"Go","fixed":["0.38.12"],"introduced":["0.38.0"],"last_affected":[],"package":"github.com/cometbft/cometbft","purl":null,"source":"GHSA-g5xx-c4hv-9ccc"},{"ecosystem":"Go","fixed":["0.38.12"],"introduced":["0.38.0"],"last_affected":[],"package":"github.com/cometbft/cometbft","purl":"pkg:golang/github.com/cometbft/cometbft","source":"GHSA-g5xx-c4hv-9ccc"},{"ecosystem":"Go","fixed":["0.34.34"],"introduced":["0.34.0"],"last_affected":[],"package":"github.com/cometbft/cometbft/light","purl":null,"source":"GHSA-g5xx-c4hv-9ccc"},{"ecosystem":"Go","fixed":["0.34.34"],"introduced":["0.34.0"],"last_affected":[],"package":"github.com/cometbft/cometbft/light","purl":"pkg:golang/github.com/cometbft/cometbft/light","source":"GHSA-g5xx-c4hv-9ccc"},{"ecosystem":"Go","fixed":["0.37.11"],"introduced":["0.37.0"],"last_affected":[],"package":"github.com/cometbft/cometbft/light","purl":null,"source":"GHSA-g5xx-c4hv-9ccc"},{"ecosystem":"Go","fixed":["0.37.11"],"introduced":["0.37.0"],"last_affected":[],"package":"github.com/cometbft/cometbft/light","purl":"pkg:golang/github.com/cometbft/cometbft/light","source":"GHSA-g5xx-c4hv-9ccc"},{"ecosystem":"Go","fixed":["0.38.12"],"introduced":["0.38.0"],"last_affected":[],"package":"github.com/cometbft/cometbft/light","purl":null,"source":"GHSA-g5xx-c4hv-9ccc"},{"ecosystem":"Go","fixed":["0.38.12"],"introduced":["0.38.0"],"last_affected":[],"package":"github.com/cometbft/cometbft/light","purl":"pkg:golang/github.com/cometbft/cometbft/light","source":"GHSA-g5xx-c4hv-9ccc"}],"products":null,"published":"2024-09-03","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"A malicious RPC endpoint can provide invalid proposer priorities during state sync, causing validators to disagree on consensus and potentially leading to a chain split.","url":"https://insights.sbomify.com/GHSA-g5xx-c4hv-9ccc/"}