Vyper vulnerable to integer overflow in loop
Impact
Due to missing overflow check for loop variables, by assigning the iterator of a loop to a variable, it is possible to overflow the type of the latter.
In the following example, calling test returns 354, meaning that the variable a did store 354 a value out of bound for the type uint8.
@external
def test() -> uint16:
x:uint8 = 255
a:uint8 = 0
for i in range(x, x+100):
a = i
return convert(a,uint16)
The issue seems to happen only in loops of type for i in range(a, a + N) as in loops of type for i in range(start, stop) and for i in range(stop), the compiler is able to raise a TypeMismatch when trying to overflow the variable.
thanks to @trocher for reporting
Patches
patched in 3de1415ee77a9244eb04bdb695e249d3ec9ed868
Workarounds
Czego dotyczy
Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.
| Platforma | Paczka | Podatne wersje | Poprawka w wersji |
|---|---|---|---|
| Python (PyPI) | vyper | < 0.3.8 | 0.3.8 |
Odnośniki
- https://github.com/vyperlang/vyper/security/advisories/GHSA-6r8q-pfpv-7cgj
- https://github.com/vyperlang/vyper/commit/3de1415ee77a9244eb04bdb695e249d3ec9ed868
- https://nvd.nist.gov/vuln/detail/CVE-2023-32058
- https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2023-78.yaml
- https://github.com/vyperlang/vyper
- Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H- Słabość (CWE)
CWE-190- Platforma
- Python (PyPI)
- Paczka
vyper- Ujawniono
- 11.05.2023
- Aktualizacja
- 11.10.2026 15:17
Źródła i licencje
OSV / GitHub Advisory Database - PYSEC-2023-78 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-6r8q-pfpv-7cgj - CC BY 4.0
Historia podatności: vyper
Wszystkie opisane podatności tej paczki (Python (PyPI)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.
- Wszystkich wpisów
- 47
- Pierwsza → ostatnia
- 03.2020 10.2026
- Bez poprawki
- 5
- Wykorzystywana w atakach
- 0
Rozkład istotności
- Krytyczna 3
- Wysoka 14
- Średnia 20
- Niska 10
Ujawnienia w latach
- 2020: 1
- 2021: 5
- 2022: 4
- 2023: 14
- 2024: 14
- 2025: 6
- 2026: 3
-
Vyper vulnerable to integer overflow in loop ten wpis
Dowiedz się, które podatności dotyczą Twojej aplikacji
Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.