# GHSA-7mm3-vfg8-7rg6: Babylon Finality Provider `MsgCommitPubRandList` replay attack

> Attackers can replay signatures to inject invalid randomness commitments, disrupting finality provider operations in the Babylon protocol.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 May 2025
- **Also known as:** GO-2025-3686

## What is GHSA-7mm3-vfg8-7rg6?

GHSA-7mm3-vfg8-7rg6 is a vulnerability in github.com/babylonlabs-io/babylon, published on 15 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Summary

A high vulnerability exists in the Babylon protocol's x/finality module due to a lack of domain separation in signed messages, combined with insufficient validation in the MsgCommitPubRandList handler. Specifically, the handler does not enforce that the submitted Commitment field is 32 bytes long. This allows an attacker to replay a signature originally generated for a different message (e.g., a Proof-of-Possession in MsgCreateFinalityProvider) as a MsgCommitPubRandList. By crafting the message parameters, an attacker can use the typically 20-byte address bytes (from the PoP context) to form the StartHeight, NumPubRand, and a shorter-than-expected Commitment (e.g., 4 bytes). The replayed signature will pass verification for this crafted message, leading to the injection of an invalid PubRand commitment.

### Impact

Successful exploitation of this vulnerability, specifically via the PoP signature replay, allows an attacker to store an invalid PubRand commitment (with a non-standard length, e.g., 4 bytes) for a targeted Finality Provider (FP). Despite the commitment itself being malformed, it's the associated StartHeight and NumPubRand (derived from the replayed address bytes and typically very large) that cause severe consequences

### Future recommendations

To minimize future risk of such attacks, all finality providers should:
1.  Never re-use your finality provider EOTS across the networks (e.g., the testnet) or for any other purpose. 
2. Never use EOTS keys to sign any other data than relevant to in-protocol messages. Ideally EOTS key should only be used to:
    - Sign initial proof of possession message
    - Sign periodic randomness commits
    - Sign finality votes with every block

### Finder
Vulnerability discovered by:
- Marco Hextor
- https://x.com/marcohextor
- @marcohextor

## Which versions are affected by GHSA-7mm3-vfg8-7rg6?

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-7mm3-vfg8-7rg6?

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

## Is GHSA-7mm3-vfg8-7rg6 being exploited?

There is no known exploitation of GHSA-7mm3-vfg8-7rg6 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-7mm3-vfg8-7rg6 and fix it if it is affected.

What it is: GHSA-7mm3-vfg8-7rg6 is a vulnerability in github.com/babylonlabs-io/babylon, published on 15 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-7mm3-vfg8-7rg6 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-7mm3-vfg8-7rg6/ (Markdown: https://insights.sbomify.com/GHSA-7mm3-vfg8-7rg6/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-7mm3-vfg8-7rg6

---
From sbomify Insights: https://insights.sbomify.com/GHSA-7mm3-vfg8-7rg6/
Summaries are generated and may contain mistakes; the official description above is the record.
