{"id":"CVE-2022-24787","published":"2022-04-04T17:35:10Z","modified":"2025-04-23T18:41:56Z","title":"Incorrect Comparison in Vyper","vendor":"vyperlang","product":"vyper","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01029,"percentile":0.64495,"provenance":"source"},"cwes":[{"id":"CWE-697","name":"Incorrect Comparison"}],"references":[{"url":"https://github.com/vyperlang/vyper/security/advisories/GHSA-7vrm-3jc8-5wwm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/vyperlang/vyper/commit/2c73f8352635c0a433423a5b94740de1a118e508","tags":["x_refsource_MISC"]}],"priority":{"score":18.1,"factors":[{"name":"EPSS percentile","points":12.9},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"vyperlang","affectedVersions":[{"vendor":"vyperlang","product":"vyper","versions":["<= 0.3.1"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2025-04-23T15:56:07.049097Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"vyper","vulnerableRanges":["<0.3.2"],"patched":["0.3.2"],"from":["PYSEC-2022-196"],"provenance":"source"}],"summary":{"text":"Vyper, a Pythonic smart contract language for the Ethereum Virtual Machine, has a flaw in how it compares bytestrings in version 0.3.1 and earlier: comparisons can return incorrect results when bytestrings contain dirty bytes, and two bytestrings can compare equal if one ends in a null byte because lengths are not compared. An attacker able to supply network-reachable input to a contract that relies on these comparisons can cause it to treat unequal values as equal, with no authentication or user interaction required and no special configuration needed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:35:22Z"},"euvd":{"id":"EUVD-2022-0353","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-vyperlang-vyper-cve-2022-24787","children":[{"from":"CVE-2022-24787","to":"CVE-2025-21607","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["vyper/codegen/core.py"],"commits":["https://github.com/vyperlang/vyper/commit/2c73f8352635c0a433423a5b94740de1a118e508","https://github.com/vyperlang/vyper/commit/7136eab0a254aa2ff7ddca41cc05f2ee1fa99caf"],"basis":"shared function","functions":["copy_bytes"]}]}]}}