CVE-2018-18920: Py evm Py-EVM Is Vulnerable To Arbitrary Vulnerability
HIGHCVE-2018-18920 is a HIGH (CVSS 8.8) py-evm is vulnerable to arbitrary vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Py evm libraries in the PyPI ecosystem. The issue involves py-evm is vulnerable to arbitrary bytecode injection. Remediation is available in the latest vendor maintenance releases.
CVE-2018-18920 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2018-18920
To remediate this vulnerability, upgrade all affected Py 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.
pip install py-evm>=Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show py-evm
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2018-18920, inspect your installed packages using pip:
pip show py-evm
Analyze the terminal output to locate any version of Py evm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The pip show py-evm command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. In Py 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-2018-18920 Affected Py evm Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
py-evm
|
PyPI |
≤ 0.2.0a33
|
|
References
Frequently Asked Questions
What is CVE-2018-18920?
Which Py evm versions are affected?
What version fixes CVE-2018-18920?
Is py-evm affected?
What is the CVSS score of CVE-2018-18920?
What CWE is associated with CVE-2018-18920?
How can I check PyPI dependencies for CVE-2018-18920?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vqgp-4jgj-5j64",
"modified" : "2026-06-05T17:53:32Z",
"published" : "2018-11-21T22:23:04Z",
"aliases" : [ "CVE-2018-18920" ],
"summary" : "Py-EVM is vulnerable to arbitrary bytecode injection",
"details" : "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 invalid opcode. This is reportedly related to \"smart contracts can be executed indefinitely without gas being paid.\"",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "py-evm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.2.0a33"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-18920"
}, {
"type" : "WEB",
"url" : "https://github.com/ethereum/py-evm/issues/1448"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-vqgp-4jgj-5j64"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ethereum/py-evm"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/evm-py/PYSEC-2018-155.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/py-evm/PYSEC-2018-96.yaml"
}, {
"type" : "WEB",
"url" : "https://twitter.com/AlexanderFisher/status/1060923428641878019"
}, {
"type" : "WEB",
"url" : "https://twitter.com/NettaLab/status/1060889400102383617"
}, {
"type" : "WEB",
"url" : "https://www.reddit.com/r/ethereum/comments/9vkk2g/netta_labs_claim_to_have_found_a_vulnerability_in/e9d3wyx"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-119" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:58:10Z",
"nvd_published_at" : null
}
}