CVE-2022-39354
JSON

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 packageVersionsReported by
rust-blockchain evm< 0.36.0CVE List
evm (crates.io)before 0.36.0, from 0.0.0-0 before 0.36.0GitHub Advisory Database, RustSec Advisory Database
evm_project evmbefore 0.36.0NVD

All scores

GitHub_M5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHub5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
RustSec Advisory Database7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Classification

CWE-670

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:

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

Sources

SourceRecordLicence
CVE ListCVE-2022-39354 changed 2025-04-23CVE Terms of Use
GitHub Advisory DatabaseGHSA-hhc4-47rh-cr34 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2022-0083 changed 2023-11-08CC0-1.0
NVDCVE-2022-39354 changed 2026-06-17Public domain