# GHSA-86h5-xcpx-cfqc: ASA-2024-005: Potential slashing evasion during re-delegation

> Attackers can evade slashing penalties for byzantine validator behavior by re-delegating before the penalty is applied, affecting Cosmos SDK users.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Feb 2024
- **Also known as:** GO-2024-2584

## What is GHSA-86h5-xcpx-cfqc?

GHSA-86h5-xcpx-cfqc is a vulnerability in github.com/cosmos/cosmos-sdk, published on 27 Feb 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

## ASA-2024-005: Potential slashing evasion during re-delegation

**Component**: Cosmos SDK
**Criticality**: Low
**Affected Versions**: Cosmos SDK versions <= 0.50.4; <= 0.47.9
**Affected Users**: Chain developers, Validator and Node operators
**Impact**: Slashing Evasion

## Summary

An issue was identified in the slashing mechanism that may allow for the evasion of slashing penalties during a slashing event. If a delegation contributed to byzantine behavior of a validator, and the validator has not yet been slashed, it may be possible for that delegation to evade a pending slashing penalty through re-delegation behavior. Additional validation logic was added to restrict this behavior.

## 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/GHSA-86h5-xcpx-cfqc). For more information about Cosmos SDK, see https://docs.cosmos.network/.

This issue was found by cat shark (Khanh) who reported it to the Cosmos Bug Bounty Program on HackerOne on December 6, 2023. 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.

## Which versions are affected by GHSA-86h5-xcpx-cfqc?

5 open source packages ship an affected version, including github.com/cosmos/cosmos-sdk.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/cosmos/cosmos-sdk` | Go | All versions | 0.47.10, 0.50.5 |
| `github.com/cosmos/cosmos-sdk` | Go | All versions | 0.47.10 |
| `github.com/cosmos/cosmos-sdk` | Go | All versions | 0.47.10 |
| `github.com/cosmos/cosmos-sdk` | Go | From 0.50.0 | 0.50.5 |
| `github.com/cosmos/cosmos-sdk` | Go | From 0.50.0 | 0.50.5 |

## How do I fix GHSA-86h5-xcpx-cfqc?

Upgrade github.com/cosmos/cosmos-sdk to a fixed version for your release line: 0.47.10 or 0.50.5.

## Is GHSA-86h5-xcpx-cfqc being exploited?

There is no known exploitation of GHSA-86h5-xcpx-cfqc in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-86h5-xcpx-cfqc and fix it if it is affected.

What it is: GHSA-86h5-xcpx-cfqc is a vulnerability in github.com/cosmos/cosmos-sdk, published on 27 Feb 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-86h5-xcpx-cfqc in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/cosmos/cosmos-sdk (Go): affected all versions; fixed in 0.47.10, 0.50.5
- github.com/cosmos/cosmos-sdk (Go): affected all versions; fixed in 0.47.10
- github.com/cosmos/cosmos-sdk (Go): affected all versions; fixed in 0.47.10
- github.com/cosmos/cosmos-sdk (Go): affected from 0.50.0; fixed in 0.50.5
- github.com/cosmos/cosmos-sdk (Go): affected from 0.50.0; fixed in 0.50.5

Task:
1. 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.
2. 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.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-86h5-xcpx-cfqc/ (Markdown: https://insights.sbomify.com/GHSA-86h5-xcpx-cfqc/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-86h5-xcpx-cfqc

---
From sbomify Insights: https://insights.sbomify.com/GHSA-86h5-xcpx-cfqc/
Summaries are generated and may contain mistakes; the official description above is the record.
