CVE-2023-28431 is a high-severity (CVSS 7.5) CWE-682 vulnerability in pallet-evm-precompile-modexp. The records list no fixed version yet; check the vendor advisory below and apply the mitigations in the meantime.
Frontier's modexp precompile is slow for even modulus
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2023-28431.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
pallet-evm-precompile-modexpReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
Impact
Frontier's modexp precompile uses num-bigint crate under the hood. In the implementation, the cases for modulus being even and modulus being odd are treated separately. Odd modulus uses the fast Montgomery multiplication, and even modulus uses the slow plain power algorithm. This gas cost discrepancy was not accounted for in the modexp precompile, leading to possible denial of service attacks.
Patches
No fixes for num-bigint is currently available, and thus this advisory will be first fixed in the short term by raising the gas costs for even modulus, and in the long term fixing it in num-bigint or switching to another modexp implementation.
The short-term fix for Frontier is deployed at PR 1017.
The recommendations are as follows:
- If you anticipate malicious validators, it's recommended to issue an emergency runtime upgrade as soon as possible.
- If you do not anticipate malicious validators, it's recommended to issue a normal runtime upgrade, as Substrate has builtin timeout protection when validators are building blocks.
Workarounds
None.
References
A similar issue was presented in Geth's implementation and the fix can be found here.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | pallet-evm-precompile-modexp | all versions | No fix |
Affected Products
frontierparityDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for pallet-evm-precompile-modexp, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Remediation status
The records we use list no patched version of pallet-evm-precompile-modexp for CVE-2023-28431. Check the maintainer's advisory, and where your build allows, override or pin the dependency away from the vulnerable range.
Mitigate without a patch
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is CVE-2023-28431 in your dependencies?
Find it across crates.io, including transitive dependencies.