Niska

Vyper's `slice()` may elide side-effects when output length is 0

  • Ujawniono: 16.05.2025
  • Aktualizacja: 11.10.2026 13:19

Impact

the slice() builtin can elide side effects when the output length is 0, and the source bytestring is a builtin (msg.data or <address>.code). the reason is that for these source locations, the check that length >= 1 is skipped: https://github.com/vyperlang/vyper/blob/68b68c4b30c5ef2f312b4674676170b8a6eaa316/vyper/builtins/functions.py#L315-L319

the result is that a 0-length bytestring constructed with slice can be passed to make_byte_array_copier, which elides evaluation of its source argument when the max length is 0: https://github.com/vyperlang/vyper/blob/68b68c4b30c5ef2f312b4674676170b8a6eaa316/vyper/codegen/core.py#L189-L191

the impact is that side effects in the start argument may be elided when the length argument is 0, e.g. slice(msg.data, self.do_side_effect(), 0).

the following example illustrates how the issue would look in user code

vyper
counter: public(uint256)

@external
def test() -> Bytes[10]:
    b: Bytes[10] = slice(msg.data, self.side_effect(), 0)
    return b

def side_effect() -> uint256:
    self.counter += 1
    return 0

the severity assigned is low, since this is not a very useful pattern and unlikely to be found in user code.

Patches

the fix is tracked in https://github.com/vyperlang/vyper/pull/4645, which disallows any invocation of slice() with length 0, including for the ad hoc locations discussed in this advisory.

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading?

References

Are there any links users can visit to find out more?

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Python (PyPI) vyper <= 0.4.2rc1 brak poprawki

Odnośniki

Ocena CVSS -
Wektor CVSS
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P
Słabość (CWE)
CWE-691
Platforma
Python (PyPI)
Paczka
vyper
Ujawniono
16.05.2025
Aktualizacja
11.10.2026 13:19

Źródła i licencje

OSV / GitHub Advisory Database - PYSEC-2026-2028 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-3vcg-j39x-cwfm - 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ć.

Wszystkie (47) w archiwum
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

  1. 2020: 1
  2. 2021: 5
  3. 2022: 4
  4. 2023: 14
  5. 2024: 14
  6. 2025: 6
  7. 2026: 3
Istotność:
  1. Vyper's `slice()` may elide side-effects when output length is 0 ten wpis
    Niska CVE-2025-47774 <= 0.4.2rc1 brak poprawki
  2. Krytyczna · 9.8 CVE-2024-24563 < 0.4.0 0.4.0
  3. Krytyczna · 9.8 CVE-2024-24561 < 0.4.0 0.4.0
  4. Wysoka · 7.3 CVE-2024-22419 >= 0.3.0, < 0.4.0 0.4.0
  5. Wysoka · 7.5 CVE-2023-46247 < 0.3.8 0.3.8
  6. Wysoka · 8.1 CVE-2023-42443 >= 0.3.4, < 0.3.10 0.3.10
  7. Krytyczna · 8.7 CVE-2023-39363 >= 0.2.15, < 0.3.1 0.3.1
  8. Wysoka · 7.5 CVE-2023-32058 < 0.3.8 0.3.8
  9. Wysoka · 7.5 CVE-2023-30837 < 0.3.8 0.3.8
  10. Wysoka · 7.5 CVE-2023-30629 >= 0.3.1, < 0.3.8 0.3.8
  11. Wysoka · 7.5 CVE-2022-29255 < 0.3.4 0.3.4
  12. Wysoka · 7.1 CVE-2022-24788 < 0.3.2 0.3.2
  13. Wysoka · 7.5 CVE-2022-24787 < 0.3.2 0.3.2
  14. Wysoka ghsa-7f92-rr6w-cq64 >= 0.2.13, < 0.2.15 0.2.15

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.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.