# CVE-2022-24787: Incorrect Comparison in Vyper

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.03%, higher than 64% of CVEs (2026-12-01)
- Published: 2022-04-04T17:35:10.000Z
- Modified: 2026-06-17T04:32:31.100Z
- Also known as: GHSA-7vrm-3jc8-5wwm, PYSEC-2022-196
- Weaknesses: CWE-697
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- vyperlang vyper: <= 0.3.1; up to 0.3.1
- vyper (PyPI): before 0.3.2; before 2c73f8352635c0a433423a5b94740de1a118e508

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:N/I:P/A:N`

## References

- <https://github.com/vyperlang/vyper/security/advisories/GHSA-7vrm-3jc8-5wwm> (advisory, patch, third-party-advisory, web)
- <https://github.com/vyperlang/vyper/commit/2c73f8352635c0a433423a5b94740de1a118e508> (fix, patch, third-party-advisory, web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2022-196.yaml> (web)
- <https://github.com/vyperlang/vyper> (package)

## Sources

- CVE List: [CVE-2022-24787](https://www.cve.org/CVERecord?id=CVE-2022-24787), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-7vrm-3jc8-5wwm](https://github.com/advisories/GHSA-7vrm-3jc8-5wwm), CC-BY-4.0, modified 2024-12-05
- NVD: [CVE-2022-24787](https://nvd.nist.gov/vuln/detail/CVE-2022-24787), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2022-196](https://osv.dev/vulnerability/PYSEC-2022-196), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2022-24787 · Whole record: https://cve.day/CVE-2022-24787.json · Rebuilt by cve.day 2026-11-25T22:58:10.398Z
