{"id":"CVE-2022-24787","summary":"Incorrect Comparison in Vyper","details":"Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine. In version 0.3.1 and prior, bytestrings can have dirty bytes in them, resulting in the word-for-word comparisons giving incorrect results. Even without dirty nonzero bytes, two bytestrings can compare to equal if one ends with `\"\\x00\"` because there is no comparison of the length. A patch is available and expected to be part of the 0.3.2 release. There are currently no known workarounds.","aliases":["GHSA-7vrm-3jc8-5wwm","PYSEC-2022-196"],"modified":"2026-08-12T03:30:53.122989816Z","published":"2022-04-04T17:35:10Z","database_specific":{"cwe_ids":["CWE-697"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/24xxx/CVE-2022-24787.json","cna_assigner":"GitHub_M"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/24xxx/CVE-2022-24787.json"},{"type":"ADVISORY","url":"https://github.com/vyperlang/vyper/security/advisories/GHSA-7vrm-3jc8-5wwm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24787"},{"type":"FIX","url":"https://github.com/vyperlang/vyper/commit/2c73f8352635c0a433423a5b94740de1a118e508"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/vyperlang/vyper","events":[{"introduced":"0"},{"fixed":"2c73f8352635c0a433423a5b94740de1a118e508"}],"database_specific":{"cpe":"cpe:2.3:a:vyperlang:vyper:*:*:*:*:*:*:*:*","extracted_events":[{"introduced":"0"},{"last_affected":"0.3.1"}],"source":["CPE_RANGE","REFERENCES"]}}],"versions":["v0.3.1","v0.3.0","v0.2.16","v0.2.15","v0.2.14","v0.2.13","v0.2.12","v0.2.11","v0.2.10","v0.2.9","v0.2.8","v0.2.7","v0.2.6","v0.2.5","v0.2.4","v0.2.3","v0.2.2","v0.2.1","0.2.1","v0.2.0","v0.1.0-beta.17","v0.1.0-beta.16","v0.1.0-beta.15","v0.1.0-beta.14","v0.1.0-beta.13","v0.1.0-beta.12","v0.1.0-beta.11","v0.1.0-beta.10","v0.1.0-beta.9","v0.1.0-beta.8","v0.1.0-beta.7","v0.1.0-beta.6","v0.1.0-beta.5","v0.1.0-beta.3","v0.1.0-beta.2","v0.1.0-beta.1","v0.0.4"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-24787.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"}]}