5.9medium
evm has incorrect is_static parameter for custom stateful precompiles
- Severity
- 5.9medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.70% (higher than 54% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-hhc4-47rh-cr34RUSTSEC-2022-0083
Description
SputnikVM, also called evm, is a Rust implementation of Ethereum Virtual Machine. A 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. Prior to version 0.36.0, the passed `is_static` parameter was incorrect -- it was only set to `true` if the call came from a direct `STATICCALL` opcode. However, once a static call context is entered, it should stay static. The issue only impacts custom precompiles that actually uses `is_static`. For those affected, the issue can lead to possible incorrect state transitions. Version 0.36.0 contains a patch. There are no known workarounds.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rust-blockchain evm | < 0.36.0 | CVE List |
| evm (crates.io) | before 0.36.0, from 0.0.0-0 before 0.36.0 | GitHub Advisory Database, RustSec Advisory Database |
| evm_project evm | before 0.36.0 | NVD |
All scores
| GitHub_M | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N |
| RustSec Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
SputnikVM, also called evm, is a Rust implementation of Ethereum Virtual Machine. A 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. Prior to version 0.36.0, the passed `is_static` parameter was incorrect -- it was only set to `true` if the call came from a direct `STATICCALL` opcode. However, once a static call context is entered, it should stay static. The issue only impacts custom precompiles that actually uses `is_static`. For those affected, the issue can lead to possible incorrect state transitions. Version 0.36.0 contains a patch. There are no known workarounds.
GitHub Advisory Database
Impact
A 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.
The 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.
Patches
PR: https://github.com/rust-blockchain/evm/pull/133 Released in v0.36.0.
Older patch versions can be released on request if anyone needs them. Simply contact @sorpaas by email to request it.
For more information
If you have any questions or comments about this advisory:
- Open an issue in evm repo
- Email Wei at wei@that.world
RustSec Advisory Database
SputnikVM, also called evm, is a Rust implementation of Ethereum Virtual Machine.
A 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.
Prior to version 0.36.0, the passed is_static parameter was incorrect -- it
was only set to true if the call came from a direct STATICCALL opcode.
However, once a static call context is entered, it should stay static. The issue
only impacts custom precompiles that actually uses is_static.
For those affected, the issue can lead to possible incorrect state transitions.
NVD (es)
SputnikVM, también llamado evm, es una implementación en Rust de la máquina virtual de Ethereum. Una precompilación personalizada con estado puede usar el parámetro "is_static" para determinar si la llamada es ejecutada en un contexto estático (por medio de "STATICCALL"), y así decidir si es debido realizar operaciones con estado. versiones anteriores a 0.36.0, el parámetro pasado "is_static" era incorrecto -- sólo se ponía a "true" si la llamada provenía de un opcode directo "STATICCALL". Sin embargo, una vez que es introducido un contexto de llamada estática, debería permanecer estático. El problema sólo afecta a los precompiladores personalizados que realmente usan "is_static". Para los afectados, el problema puede conllevar a posibles transiciones de estado incorrectas. La versión 0.36.0 contiene un parche. No se presentan mitigaciones conocidas
References
| https://github.com/rust-blockchain/evm/security/advisories/GHSA-hhc4-47rh-cr34 | third-party-advisory, web | |
| https://github.com/rust-blockchain/evm/pull/133 | patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-39354 | advisory | |
| https://github.com/rust-blockchain/evm | package | |
| https://rustsec.org/advisories/RUSTSEC-2022-0083.html | advisory, web | |
| https://crates.io/crates/evm | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-39354 changed 2025-04-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-hhc4-47rh-cr34 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2022-0083 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2022-39354 changed 2026-06-17 | Public domain |