CVE-2023-28431

Source
https://cve.org/CVERecord?id=CVE-2023-28431
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-28431.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2023-28431
Aliases
Published
2023-03-22T20:11:43.772Z
Modified
2026-04-10T04:56:55.855439Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Frontier's modexp precompile is slow for even modulus
Details

Frontier is an Ethereum compatibility layer for Substrate. Frontier's modexp precompile uses num-bigint crate under the hood. In the implementation prior to pull request 1017, 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.

No fixes for num-bigint are currently available, and thus this issue is 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 pull request 1017. There are no known workarounds aside from applying the fix.

Database specific
{
    "cna_assigner": "GitHub_M",
    "cwe_ids": [
        "CWE-682"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/28xxx/CVE-2023-28431.json"
}
References

Affected packages

Git / github.com/polkadot-evm/frontier

Affected ranges

Type
GIT
Repo
https://github.com/polkadot-evm/frontier
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Type
GIT
Repo
https://github.com/polkadot-evm/frontier
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed

Affected versions

fc-consensus-v1.*
fc-consensus-v1.0.0
fc-consensus-v2.*
fc-consensus-v2.0.0
fc-db-v1.*
fc-db-v1.0.0
fc-mapping-sync-v1.*
fc-mapping-sync-v1.0.0
fc-rpc-core-v1.*
fc-rpc-core-v1.0.0
fc-rpc-v1.*
fc-rpc-v1.0.0
fp-consensus-v1.*
fp-consensus-v1.0.0
fp-evm-v1.*
fp-evm-v1.0.0
fp-evm-v2.*
fp-evm-v2.0.0
fp-rpc-v1.*
fp-rpc-v1.0.0
fp-rpc-v2.*
fp-rpc-v2.0.0
fp-rpc-v2.1.0
fp-storage-v1.*
fp-storage-v1.0.0
fp-storage-v1.0.1
fp-storage-v2.*
fp-storage-v2.0.0
pallet-dynamic-fee-v1.*
pallet-dynamic-fee-v1.0.0
pallet-dynamic-fee-v2.*
pallet-dynamic-fee-v2.0.0
pallet-dynamic-fee-v3.*
pallet-dynamic-fee-v3.0.0
pallet-ethereum-v1.*
pallet-ethereum-v1.0.0
pallet-ethereum-v2.*
pallet-ethereum-v2.0.0
pallet-ethereum-v3.*
pallet-ethereum-v3.0.0
pallet-evm-precompile-blake2-v1.*
pallet-evm-precompile-blake2-v1.0.0
pallet-evm-precompile-bn128-v1.*
pallet-evm-precompile-bn128-v1.0.0
pallet-evm-precompile-dispatch-v1.*
pallet-evm-precompile-dispatch-v1.0.0
pallet-evm-precompile-ed25519-v1.*
pallet-evm-precompile-ed25519-v1.0.0
pallet-evm-precompile-modexp-v1.*
pallet-evm-precompile-modexp-v1.0.0
pallet-evm-precompile-sha3fips-v1.*
pallet-evm-precompile-sha3fips-v1.0.0
pallet-evm-precompile-simple-v1.*
pallet-evm-precompile-simple-v1.0.0
pallet-evm-v3.*
pallet-evm-v3.0.0
pallet-evm-v4.*
pallet-evm-v4.0.0
pallet-evm-v5.*
pallet-evm-v5.0.0

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-28431.json"
unresolved_ranges
[
    {
        "events": [
            {
                "introduced": "0"
            },
            {
                "fixed": "2023-03-15"
            }
        ]
    }
]