CVE-2018-18920: py-evm - Smart Contract Execution Failure

py-evm Updated 02 Oct 2025

Summary

12/11/2018
Yes i
High
8.8

CVE-2018-18920: Py-EVM v0.2.0-alpha.33 allows attackers to make a vm.execute_bytecode call that triggers computation._stack.values with '"stack": [100, 100, 0]' where b'\x' was expected, resulting in an execution failure because of an i... Affects py-evm versions < 0.2.0a33. Fixed in 0.2.0a33. How to fix ↓

Also tracked for

The same CVE-2018-18920 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

py-evm is a Python library that implements the Ethereum Virtual Machine (EVM) for executing smart contracts. It provides developers with the tools to create and interact with Ethereum-compatible blockchain networks. The library allows the execution of smart contracts written in Solidity, the programming language used for Ethereum smart contracts. However, a vulnerability has been discovered in py-evm that can lead to smart contract execution failures and the possibility of indefinite execution without gas being paid.

Vulnerability Detail

The vulnerability (CVE-2018-18920) in py-evm version 0.2.0-alpha.33 arises from a flaw in the vm.execute_bytecode function. Attackers can exploit this vulnerability by making a call to vm.execute_bytecode with a specific input that triggers computation._stack.values with '"stack": [100, 100, 0]' instead of the expected b'\x' values. This results in an execution failure due to an invalid opcode. The vulnerability is related to the ability to execute smart contracts indefinitely without paying gas. If exploited, this vulnerability can disrupt the execution of smart contracts and potentially lead to financial losses or other security issues.

How To Fix

Minimum fixed version

0.2.0a33

This is the first release that contains the fix.

pip install --upgrade "py-evm==0.2.0a33"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to upgrade to the fixed version of py-evm as soon as possible.

Conclusion

The vulnerability (CVE-2018-18920) in py-evm version 0.2.0-alpha.33 allows attackers to trigger execution failures and potentially execute smart contracts indefinitely without paying gas. Users should upgrade to the fixed version of py-evm to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for py-evm →

Share this vulnerability

FAQ

py-evm is a Python library that implements the Ethereum Virtual Machine (EVM) for executing smart contracts on Ethereum-compatible blockchain networks.

This vulnerability can lead to smart contract execution failures and the possibility of indefinite execution without gas being paid. It can disrupt the execution of smart contracts and potentially result in financial losses or other security issues.

To fix this vulnerability, you should upgrade to py-evm version 0.2.0-alpha.33 or later.

There is no known workaround for this vulnerability. It is recommended to upgrade to the fixed version of py-evm.

How To Fix

Minimum fixed version

0.2.0a33

This is the first release that contains the fix.

pip install --upgrade "py-evm==0.2.0a33"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback