{"id":"CVE-2023-32058","summary":"Vyper vulnerable to integer overflow in loop","details":"Vyper is a Pythonic smart contract language for the Ethereum virtual machine. Prior to version 0.3.8, due to missing overflow check for loop variables, by assigning the iterator of a loop to a variable, it is possible to overflow the type of the latter. The issue seems to happen only in loops of type `for i in range(a, a + N)` as in loops of type `for i in range(start, stop)` and `for i in range(stop)`, the compiler is able to raise a `TypeMismatch` when trying to overflow the variable. The problem has been patched in version 0.3.8.","aliases":["GHSA-6r8q-pfpv-7cgj","PYSEC-2023-78"],"modified":"2026-03-20T12:28:11.379027Z","published":"2023-05-11T20:55:35.195Z","database_specific":{"cwe_ids":["CWE-190"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/32xxx/CVE-2023-32058.json","cna_assigner":"GitHub_M"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/32xxx/CVE-2023-32058.json"},{"type":"ADVISORY","url":"https://github.com/vyperlang/vyper/security/advisories/GHSA-6r8q-pfpv-7cgj"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-32058"},{"type":"FIX","url":"https://github.com/vyperlang/vyper/commit/3de1415ee77a9244eb04bdb695e249d3ec9ed868"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/vyperlang/vyper","events":[{"introduced":"0"},{"fixed":"036f153683e0d55b890305eb4c77680a0872fcba"}]}],"versions":["0.2.1","pre-release","v0.0.4","v0.1.0-beta.1","v0.1.0-beta.10","v0.1.0-beta.11","v0.1.0-beta.12","v0.1.0-beta.13","v0.1.0-beta.14","v0.1.0-beta.15","v0.1.0-beta.16","v0.1.0-beta.17","v0.1.0-beta.2","v0.1.0-beta.3","v0.1.0-beta.4","v0.1.0-beta.5","v0.1.0-beta.6","v0.1.0-beta.7","v0.1.0-beta.8","v0.1.0-beta.9","v0.2.0","v0.2.1","v0.2.10","v0.2.11","v0.2.12","v0.2.13","v0.2.14","v0.2.15","v0.2.16","v0.2.2","v0.2.3","v0.2.4","v0.2.5","v0.2.6","v0.2.7","v0.2.8","v0.2.9","v0.3.0","v0.3.1","v0.3.2","v0.3.3","v0.3.4","v0.3.5","v0.3.6","v0.3.7"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-32058.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}