Vyper's `slice()` may elide side-effects when output length is 0
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- —
- Confidentiality · integrity · availability
- None · Low · None
- Fix status
- No fix listed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub.
Summary
Vyper is the Pythonic Programming Language for the Ethereum Virtual Machine. In versions up to and including 0.4.2rc1, 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. 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. 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 fix in pull request 4645 disallows any invocation of `slice()` with length 0, including for the ad hoc locations discussed in this advisory. The fix is expected to be part of version 0.4.2.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| vyperlang | vyper | up to 0.4.2rc1 | — | No fix listed | CNA |
| — | vyper (PyPI) | up to 0.4.2rc1 | — | No fix listed | GHSA-3vcg-j39x-cwfm |
- vyper Vendorvyperlang Affected up to 0.4.2rc1 Fixed in — No fix listed CNA
- vyper (PyPI) Vendor— Affected up to 0.4.2rc1 Fixed in — No fix listed GHSA-3vcg-j39x-cwfm
Remediation
No fixed version listed by the sources yet.
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2025-47774
- 2026-10-03 Alias added: GHSA-3vcg-j39x-cwfm
References
Other 5
- https://github.com/vyperlang/vyper/security/advisories/GHSA-3vcg-j39x-cwfm
- https://github.com/vyperlang/vyper/pull/4645
- https://github.com/vyperlang/vyper/blob/68b68c4b30c5ef2f312b4674676170b8a6eaa316/vyper/builtins/functions.py#L315-L319
- https://github.com/vyperlang/vyper/blob/68b68c4b30c5ef2f312b4674676170b8a6eaa316/vyper/codegen/core.py#L189-L191
- https://github.com/vyperlang/vyper
More vyperlang vulnerabilities
- TI-2024-16182 Vyper bounds check on built-in `slice()` function can be overflowed CVSS 3.1CRITICAL 9.8
- TI-2024-14992 concat built-in can corrupt memory in vyper CVSS 3.1CRITICAL 9.8
- TI-2024-16184 Vyper array negative index vulnerability CVSS 3.1CRITICAL 9.8
- TI-2022-08657 Integer bounds error in Vyper CVSS 3.1CRITICAL 9.8
- TI-2022-11796 Multiple evaluation of contract address in call in vyper CVSS 3.1HIGH 8.2
- TI-2026-78730 Optimizer miscompilation of msg.value | K in Vyper ternary branches CVSS 4.0HIGH 8.2
Sources
- CVE-2025-47774 · CVE Program
- CVE-2025-47774 · NVD
- FIRST EPSS
- GHSA-3vcg-j39x-cwfm · GitHub Advisory Database · CC BY 4.0
- CVE-2025-47774 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences