CVE-2022-24787
mediumpriority · track · 30EPSS 0.010 · 64 %ileEUUSEPSS · scored 2026-10-27
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 5–7.5
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (3)
Products and version ranges known to be affected.
advisories (2)
Vendor and ecosystem advisories describing this.
- GHSA-7vrm-3jc8-5wwmIncorrect Comparison in Vyper2022-04-04ghsa · osvUS
### Impact bytestrings can have dirty bytes in them, resulting in the word-for-word comparison to give incorrect results, e.g. ```vyper b1: Bytes[32] = b"abcdef" b1 = slice(b1, 0, 1) b2: Bytes[32] = b"abcdef" t: bool = b1 == b2 # incorrectly evaluates to True ``` even without dirty nonzero bytes, because there is no comparison of the length, two bytestrings can compare to equal if one ends with `"\x00"`. ```vyper b1: Bytes[32] = b"abc\0" b2: Bytes[32] = b"abc" t: bool = b1 == b2 # incorrectly evaluates to True ``` ### Patches fixed in https://github.com/vyperlang/vyper/commit/2c73f8352635c0a433423a5b94740de1a118e508
- PYSEC-2022-1962022-04-04vendor · osvUS
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.
also known as (6)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (7)
External citations — patches, advisories, analysis.
- https://cxsecurity.com/cveshow/CVE-2022-24787/cnnvd
- https://github.com/vyperlang/vyper/commit/2c73f8352635c0a433423a5b94740de1a118e508cnnvd
- https://github.com/vyperlang/vyper/security/advisories/GHSA-7vrm-3jc8-5wwmcnnvd
- https://github.com/vyperlang/vyper/commit/2c73f8352635c0a433423a5b94740de1a118e508enisa_euvd
- https://github.com/vyperlang/vyper/security/advisories/GHSA-7vrm-3jc8-5wwmenisa_euvd
- https://github.com/vyperlang/vyper/commit/2c73f8352635c0a433423a5b94740de1a118e508PatchThird Party Advisorynvd
- https://github.com/vyperlang/vyper/security/advisories/GHSA-7vrm-3jc8-5wwmPatchThird Party Advisorynvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan