Skip to content

Incorrect is_static parameter for custom stateful precompiles

High
sorpaas published GHSA-hhc4-47rh-cr34 Oct 25, 2022

Package

cargo evm (Rust)

Affected versions

<= 0.35.0

Patched versions

0.36.0

Description

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. We estimate the usage is low. However, for those affected, it can lead to possible incorrect state transitions, and thus it's given high severity rating.

Patches

PR: #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:

Severity

High

CVE ID

CVE-2022-39354

Weaknesses

No CWEs