# GHSA-869w-47c6-fq8q: Babylon Integer Overflow in Distribution Module CumulativeRewardRatio Calculation Leading to Chain Halt

> An attacker can halt the Babylon blockchain by triggering an integer overflow in reward calculations via token deposits, causing a chain-wide denial of service.

- **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:** 15 May 2025
- **Also known as:** GO-2025-3687

## What is GHSA-869w-47c6-fq8q?

GHSA-869w-47c6-fq8q is a vulnerability in github.com/babylonlabs-io/babylon, published on 15 May 2025. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Summary
Minting large amount of tokens through ibc transfer and then depositing them in validator rewards pool (via `DepositValidatorRewardsPool` message) can lead to integer overflow panic when calculating `cumulative_reward_ratio` for the validator.

This calculation happens in `x/epoching` module `EndBlocker`, thus the panic will halt the chain.

### Impact

Denial of Service - Due to panic in the `EndBlocker` Babylon Genesis will halt

## Which versions are affected by GHSA-869w-47c6-fq8q?

3 open source packages ship an affected version, including github.com/babylonlabs-io/babylon.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/babylonlabs-io/babylon` | Go | All versions | None |
| `github.com/babylonlabs-io/babylon` | Go | All versions | 1.1.0 |
| `github.com/babylonlabs-io/babylon` | Go | All versions | 1.1.0 |

## How do I fix GHSA-869w-47c6-fq8q?

Upgrade github.com/babylonlabs-io/babylon to 1.1.0 or later.

## Is GHSA-869w-47c6-fq8q being exploited?

There is no known exploitation of GHSA-869w-47c6-fq8q in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-869w-47c6-fq8q and fix it if it is affected.

What it is: GHSA-869w-47c6-fq8q is a vulnerability in github.com/babylonlabs-io/babylon, published on 15 May 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-869w-47c6-fq8q in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/babylonlabs-io/babylon (Go): affected all versions; no fix listed
- github.com/babylonlabs-io/babylon (Go): affected all versions; fixed in 1.1.0
- github.com/babylonlabs-io/babylon (Go): affected all versions; fixed in 1.1.0

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-869w-47c6-fq8q/ (Markdown: https://insights.sbomify.com/GHSA-869w-47c6-fq8q/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-869w-47c6-fq8q

---
From sbomify Insights: https://insights.sbomify.com/GHSA-869w-47c6-fq8q/
Summaries are generated and may contain mistakes; the official description above is the record.
