CVE-2022-39354: Evm Incorrect Is_static Parameter For Custom Vulnerability
MODERATECVE-2022-39354 is a MODERATE (CVSS 5.9) incorrect is_static parameter for custom vulnerability (CWE-670: Always-Incorrect Control Flow Implementation) affecting Evm libraries in the crates.io ecosystem. The issue involves incorrect is_static parameter for custom stateful precompiles in sputnikvm (evm). Remediation is available by upgrading affected packages to version 0.36.0.
CVE-2022-39354 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2022-39354
To remediate this vulnerability, upgrade all affected Evm 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 evm to 0.36.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for evm
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-39354, inspect your project dependencies for Evm:
inspect dependencies for evm
Analyze the terminal output to locate any version of Evm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.36.0), 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-670: Always-Incorrect Control Flow Implementation, where the code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated. In Evm, 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-39354 Affected Evm Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
evm
|
crates.io |
< 0.36.0
|
0.36.0
|
References
Frequently Asked Questions
What is CVE-2022-39354?
Which Evm versions are affected?
What version fixes CVE-2022-39354?
Is evm affected?
What is the CVSS score of CVE-2022-39354?
What CWE is associated with CVE-2022-39354?
How can I check crates.io dependencies for CVE-2022-39354?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hhc4-47rh-cr34",
"modified" : "2022-10-25T22:27:21Z",
"published" : "2022-10-25T22:27:21Z",
"aliases" : [ "CVE-2022-39354" ],
"summary" : "Incorrect is_static parameter for custom stateful precompiles in SputnikVM (evm)",
"details" : "### Impact\n\nA custom stateful precompile can use the `is_static` parameter to determine if the call is executed in a static context (via `STATICCALL`), and thus decide if stateful operations should be done. Previously, the passed `is_static` parameter was incorrect -- it was only set to `true` if the call comes from a **direct** `STATICCALL` opcode. However, once a static call context is entered, it should stay static. \n\nThe issue only impacts custom precompiles that actually uses `is_static`. The maintainers estimate the usage is low. However, for those affected, it can lead to possible incorrect state transitions.\n\n### Patches\n\nPR: https://github.com/rust-blockchain/evm/pull/133\nReleased in v0.36.0.\n\nOlder patch versions can be released on request if anyone needs them. Simply contact @sorpaas by email to request it.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [evm repo](https://github.com/rust-blockchain/evm)\n* Email Wei at [wei@that.world](mailto:wei@that.world)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.36.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.35.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/rust-blockchain/evm/security/advisories/GHSA-hhc4-47rh-cr34"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39354"
}, {
"type" : "WEB",
"url" : "https://github.com/rust-blockchain/evm/pull/133"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/rust-blockchain/evm"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2022-0083.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-670" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-25T22:27:21Z",
"nvd_published_at" : "2022-10-25T19:15:00Z"
}
}