GHSA-7VRM-3JC8-5WWM
Incorrect Comparison in Vyper
Overview
Description
Impact
bytestrings can have dirty bytes in them, resulting in the word-for-word comparison to give incorrect results, e.g.
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".
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
Source: OX vulnerability database
Severity
7.5 · HIGH
CVSS 3.1 base score, scored by GitHub.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Affected packages · 1
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| PyPI | vyper | <0.3.2 | 0.3.2 |
Open a package to see all its vulnerabilities.
Operating systems
No Linux distribution reports this ID.
References
- github.com https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2022-196.yaml
- github.com https://github.com/vyperlang/vyper
- github.com https://github.com/vyperlang/vyper/commit/2c73f8352635c0a433423a5b94740de1a118e508
- github.com https://github.com/vyperlang/vyper/security/advisories/GHSA-7vrm-3jc8-5wwm
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.