CVE-2022-21685: Pallet evm precompile modexp Integer Underflow Vulnerability
MODERATECVE-2022-21685 is a MODERATE integer underflow vulnerability (CWE-191: Integer Underflow (Wrap or Wraparound)) affecting Pallet evm precompile modexp libraries in the crates.io ecosystem. The issue involves integer underflow in frontier. Remediation is available in the latest vendor maintenance releases.
CVE-2022-21685 at a Glance
How to Fix CVE-2022-21685
To remediate this vulnerability, upgrade all affected Pallet evm precompile modexp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade pallet-evm-precompile-modexp to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for pallet-evm-precompile-modexp
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-21685, inspect your project dependencies for Pallet evm precompile modexp:
inspect dependencies for pallet-evm-precompile-modexp
Analyze the terminal output to locate any version of Pallet evm precompile modexp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-191: Integer Underflow (Wrap or Wraparound), where the product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result. In Pallet evm precompile modexp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-21685 Affected Pallet evm precompile modexp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pallet-evm-precompile-modexp
|
crates.io |
≤ 1.0.0
|
|
References
Frequently Asked Questions
What is CVE-2022-21685?
Which Pallet evm precompile modexp versions are affected?
What version fixes CVE-2022-21685?
Is pallet-evm-precompile-modexp affected?
What CWE is associated with CVE-2022-21685?
How can I check crates.io dependencies for CVE-2022-21685?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cjg2-2fjg-fph4",
"modified" : "2024-10-24T21:50:43Z",
"published" : "2022-01-14T21:03:36Z",
"aliases" : [ "CVE-2022-21685" ],
"summary" : "Integer underflow in Frontier",
"details" : "### Impact\n\nA bug in Frontier's MODEXP precompile implementation can cause an integer underflow in certain conditions. This will cause a node crash for debug builds. For release builds (and production WebAssembly binaries), the impact is limited as it can only cause a normal EVM out-of-gas. It is recommended that you apply the patch as soon as possible.\n\nIf you do not use MODEXP precompile in your runtime, then you are not impacted.\n\n### Patches\n\nPatches are applied in PR #549.\n\n### Workarounds\n\nNone.\n\n### References\n\nPatch PR: #549\n\n### Credits\n\nThanks to SR-Labs for discovering the security vulnerability, and thanks to PureStake team for the patches.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in the [Frontier repo](https://github.com/paritytech/frontier)\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "pallet-evm-precompile-modexp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "1.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/paritytech/frontier/security/advisories/GHSA-cjg2-2fjg-fph4"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21685"
}, {
"type" : "WEB",
"url" : "https://github.com/paritytech/frontier/pull/549"
}, {
"type" : "WEB",
"url" : "https://github.com/paritytech/frontier/commit/8a93fdc6c9f4eb1d2f2a11b7ff1d12d70bf5a664"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/paritytech/frontier"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-191" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-14T19:58:51Z",
"nvd_published_at" : "2022-01-14T17:15:00Z"
}
}