{"id":"CVE-2022-24845","aliases":["EUVD-2022-0355","GHSA-j2x6-9323-fp7h","PYSEC-2022-198"],"status":"published","title":"Integer bounds error in Vyper","description":"Vyper is a pythonic Smart Contract Language for the ethereum virtual machine. In affected versions, the return of `\u003ciface\u003e.returns_int128()` is not validated to fall within the bounds of `int128`. This issue can result in a misinterpretation of the integer value and lead to incorrect behavior. As of v0.3.0, `\u003ciface\u003e.returns_int128()` is validated in simple expressions, but not complex expressions. Users are advised to upgrade. There is no known workaround for this issue.","severity":{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.01426,"percentile":0.73147,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-190"],"published":"2022-04-13T21:15:16Z","modified":"2026-10-28T02:30:28Z","fixes":[{"ecosystem":"PyPI","package":"vyper","fixed_in":["0.3.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"vyper","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.3.2"}]}]},{"source":"osv","ecosystem":"PyPI","package":"vyper","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.3.2"}]}],"versions":["0.1.0b1","0.1.0b10","0.1.0b11","0.1.0b12","0.1.0b13","0.1.0b14","0.1.0b15","0.1.0b16","0.1.0b17","0.1.0b2","0.1.0b3","0.1.0b4","0.1.0b5","0.1.0b6","0.1.0b7","0.1.0b8","0.1.0b9","0.2.1","0.2.10","0.2.11","0.2.12","0.2.13","0.2.14","0.2.15","0.2.16","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.2.7","0.2.8","0.2.9","0.3.0","0.3.1"]},{"source":"osv","ecosystem":"PyPI","package":"vyper","ranges":[{"type":"GIT","events":[{"introduced":"0"},{"fixed":"049dbdc647b2ce838fae7c188e6bb09cf16e470b"}]},{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.3.2"}]}],"versions":["0.1.0b1","0.1.0b10","0.1.0b11","0.1.0b12","0.1.0b13","0.1.0b14","0.1.0b15","0.1.0b16","0.1.0b17","0.1.0b2","0.1.0b3","0.1.0b4","0.1.0b5","0.1.0b6","0.1.0b7","0.1.0b8","0.1.0b9","0.2.1","0.2.10","0.2.11","0.2.12","0.2.13","0.2.14","0.2.15","0.2.16","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.2.7","0.2.8","0.2.9","0.3.0","0.3.1"]}],"products":[{"vendor":"vyperlang","product":"vyper"}],"references":[{"url":"https://github.com/vyperlang/vyper/commit/049dbdc647b2ce838fae7c188e6bb09cf16e470b","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/vyperlang/vyper/security/advisories/GHSA-j2x6-9323-fp7h","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Patch","Third Party Advisory","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24845","tags":["advisory"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2022-198.yaml","tags":["web"]},{"url":"https://github.com/advisories/GHSA-j2x6-9323-fp7h"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/24xxx/CVE-2022-24845.json","tags":["advisory"]},{"url":"https://github.com/vyperlang/vyper","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2022-24845","title":"Integer bounds error in Vyper","description":"Vyper is a pythonic Smart Contract Language for the ethereum virtual machine. In affected versions, the return of `\u003ciface\u003e.returns_int128()` is not validated to fall within the bounds of `int128`. This issue can result in a misinterpretation of the integer value and lead to incorrect behavior. As of v0.3.0, `\u003ciface\u003e.returns_int128()` is validated in simple expressions, but not complex expressions. Users are advised to upgrade. There is no known workaround for this issue.","status":"published","published":"2022-04-13T21:15:16Z","modified":"2025-04-22T18:15:47.013Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-190"],"updated_at":"2026-11-02T14:34:34.576287Z"}],"euvd":[{"id":"EUVD-2022-0355","description":"Vyper is a pythonic Smart Contract Language for the ethereum virtual machine. In affected versions, the return of `\u003ciface\u003e.returns_int128()` is not validated to fall within the bounds of `int128`. This issue can result in a misinterpretation of the integer value and lead to incorrect behavior. As of v0.3.0, `\u003ciface\u003e.returns_int128()` is validated in simple expressions, but not complex expressions. Users are advised to upgrade. There is no known workaround for this issue.","status":"published","published":"2022-04-13T21:15:16Z","modified":"2025-04-22T18:15:47Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T20:52:15.026784Z"}],"ghsa":[{"id":"GHSA-j2x6-9323-fp7h","title":"Integer bounds error in Vyper","description":"### Impact\nin the following code, the return of `\u003ciface\u003e.returns_int128()` is not validated to fall within the bounds of `int128`. as of v0.3.0, `\u003ciface\u003e.returns_int128()` is validated in simple expressions, but not complex expressions.\n```vyper\ninterface iface:\n    def returns_int128() -\u003e int128: view\n    def returns_Bytes33() -\u003e Bytes[33]: view\n\nx: iface\n \n@external\ndef call_out():\n    x: int128 = self.x.returns_int128()  # affected, \u003c0.3.0\n    y: uint256 = convert(self.x.returns_int128(), uint256)  # affected, \u003c0.3.2\n    z: Bytes[33] = concat(self.x.returns_Bytes33(), b\"\")  # affected \u003e= 0.3.0, \u003c0.3.2\n```\n\n### Patches\n0.3.2 (as of https://github.com/vyperlang/vyper/commit/049dbdc647b2ce838fae7c188e6bb09cf16e470b)\n\n### Workarounds\nBreak up operations involving external calls into multiple statements. For instance, instead of the example above, use\n```\nx: int128 = self.x.returns_int128()\ny: uint256 = convert(x, uint256)\n```","status":"published","published":"2022-04-22T20:24:13Z","modified":"2023-01-27T05:01:57Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-190"],"updated_at":"2026-11-02T14:36:17.04874Z"}],"nvd":[{"id":"CVE-2022-24845","description":"Vyper is a pythonic Smart Contract Language for the ethereum virtual machine. In affected versions, the return of `\u003ciface\u003e.returns_int128()` is not validated to fall within the bounds of `int128`. This issue can result in a misinterpretation of the integer value and lead to incorrect behavior. As of v0.3.0, `\u003ciface\u003e.returns_int128()` is validated in simple expressions, but not complex expressions. Users are advised to upgrade. There is no known workaround for this issue.","status":"published","published":"2022-04-13T22:15:08.33Z","modified":"2026-06-17T04:32:38.777Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"cwes":["CWE-190"],"updated_at":"2026-11-02T14:07:15.414503Z"}],"osv":[{"id":"CVE-2022-24845","title":"Integer bounds error in Vyper","description":"Vyper is a pythonic Smart Contract Language for the ethereum virtual machine. In affected versions, the return of `\u003ciface\u003e.returns_int128()` is not validated to fall within the bounds of `int128`. This issue can result in a misinterpretation of the integer value and lead to incorrect behavior. As of v0.3.0, `\u003ciface\u003e.returns_int128()` is validated in simple expressions, but not complex expressions. Users are advised to upgrade. There is no known workaround for this issue.","status":"published","published":"2022-04-13T21:15:16Z","modified":"2026-10-28T02:30:28.353918152Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-190"],"updated_at":"2026-11-02T15:44:24.428403Z"},{"id":"GHSA-j2x6-9323-fp7h","title":"Integer bounds error in Vyper","description":"### Impact\nin the following code, the return of `\u003ciface\u003e.returns_int128()` is not validated to fall within the bounds of `int128`. as of v0.3.0, `\u003ciface\u003e.returns_int128()` is validated in simple expressions, but not complex expressions.\n```vyper\ninterface iface:\n    def returns_int128() -\u003e int128: view\n    def returns_Bytes33() -\u003e Bytes[33]: view\n\nx: iface\n \n@external\ndef call_out():\n    x: int128 = self.x.returns_int128()  # affected, \u003c0.3.0\n    y: uint256 = convert(self.x.returns_int128(), uint256)  # affected, \u003c0.3.2\n    z: Bytes[33] = concat(self.x.returns_Bytes33(), b\"\")  # affected \u003e= 0.3.0, \u003c0.3.2\n```\n\n### Patches\n0.3.2 (as of https://github.com/vyperlang/vyper/commit/049dbdc647b2ce838fae7c188e6bb09cf16e470b)\n\n### Workarounds\nBreak up operations involving external calls into multiple statements. For instance, instead of the example above, use\n```\nx: int128 = self.x.returns_int128()\ny: uint256 = convert(x, uint256)\n```","status":"published","published":"2022-04-22T20:24:13Z","modified":"2023-11-08T04:08:38.494818Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-190"],"updated_at":"2026-11-02T15:46:49.977351Z"},{"id":"PYSEC-2022-198","description":"Vyper is a pythonic Smart Contract Language for the ethereum virtual machine. In affected versions, the return of `\u003ciface\u003e.returns_int128()` is not validated to fall within the bounds of `int128`. This issue can result in a misinterpretation of the integer value and lead to incorrect behavior. As of v0.3.0, `\u003ciface\u003e.returns_int128()` is validated in simple expressions, but not complex expressions. Users are advised to upgrade. There is no known workaround for this issue.","status":"published","published":"2022-04-13T22:15:00Z","modified":"2023-11-08T04:08:38.494818Z","updated_at":"2026-11-02T15:52:53.449407Z"}]}}
