# CVE-2022-31111: Discrepency in transfer value and actual value due to incorrect truncation in Frontier

> Incorrect truncation in Frontier causes discrepancies between displayed and actual transferred values, requiring an upgrade to fix.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 6 Jul 2022
- **Updated:** 23 Apr 2025
- **Also known as:** GHSA-hc8w-mx86-9fcj

## What is CVE-2022-31111?

CVE-2022-31111 is a medium-severity vulnerability in paritytech frontier, published on 6 Jul 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Frontier is Substrate's Ethereum compatibility layer. In affected versions the truncation done when converting between EVM balance type and Substrate balance type was incorrectly implemented. This leads to possible discrepancy between appeared EVM transfer value and actual Substrate value transferred. It is recommended that an emergency upgrade to be planned and EVM execution temporarily paused in the mean time. The issue is patched in Frontier master branch commit fed5e0a9577c10bea021721e8c2c5c378e16bf66 and polkadot-v0.9.22 branch commit e3e427fa2e5d1200a784679f8015d4774cedc934. This vulnerability affects only EVM internal states, but not Substrate balance states or node. You can temporarily pause EVM execution (by setting up a Substrate `CallFilter` that disables `pallet-evm` and `pallet-ethereum` calls before the patch can be applied.

Weakness: CWE-670 (Always-Incorrect Control Flow Implementation)

## Which versions are affected by CVE-2022-31111?

It affects 1 product.


Products: Parity Frontier.

## How do I fix CVE-2022-31111?

No fix has been published for CVE-2022-31111 yet. Limit exposure of the affected software until one is available.

## Is CVE-2022-31111 being exploited?

There is no known exploitation of CVE-2022-31111 in the wild and no public exploit code.

## Other vulnerabilities in paritytech frontier

- [CVE-2023-45130](https://insights.sbomify.com/CVE-2023-45130/): Frontier opcode SUICIDE touches too many storage values on large contracts (high 7.5)
- [CVE-2023-28431](https://insights.sbomify.com/CVE-2023-28431/): Frontier's modexp precompile is slow for even modulus (high 7.5)
- [CVE-2022-36008](https://insights.sbomify.com/CVE-2022-36008/): Message length overflow in frontier (high 7.1)
- [CVE-2022-21685](https://insights.sbomify.com/CVE-2022-21685/): Integer underflow in Frontier (medium 6.5)
- [CVE-2022-39242](https://insights.sbomify.com/CVE-2022-39242/): Incorrect Calculation in Frontier leads to inflated Ethereum chain gas prices (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-31111 and fix it if it is affected.

What it is: CVE-2022-31111 is a medium-severity vulnerability in paritytech frontier, published on 6 Jul 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-31111 in the wild and no public exploit code.

Affected product: paritytech frontier. No package-level version data is available, so check the vendor advisory linked from the reference page.

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/CVE-2022-31111/ (Markdown: https://insights.sbomify.com/CVE-2022-31111/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-31111
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-31111
- OSV: https://osv.dev/vulnerability/CVE-2022-31111

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-31111/
Summaries are generated and may contain mistakes; the official description above is the record.
