CVE-2023-46247 json
Vyper has incorrect storage layout for contracts containing large arrays
published 2023-12-13 2 y ago modified 2026-09-10 1 mo ago also GHSA-6m97-7527-mh74 , PYSEC-2023-307 , EUVD-2023-0276
- cvss
- 7.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.7%
- EPSS 0.7% chance of exploitation in 30 days, percentile 53%
- public exploits
- 0
- none known
Summary
Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine (EVM). Contracts containing large arrays might underallocate the number of slots they need by 1. Prior to v0.3.8, the calculation to determine how many slots a storage variable needed used `math.ceil(type_.size_in_bytes / 32)`. The intermediate floating point step can produce a rounding error if there are enough bits set in the IEEE-754 mantissa. Roughly speaking, if `type_.size_in_bytes` is large (> 2**46), and slightly less than a power of 2, the calculation can overestimate how many slots are needed by 1. If `type_.size_in_bytes` is slightly more than a power of 2, the calculation can underestimate how many slots are needed by 1. This issue is patched in version 0.3.8.
Patch / fix
Exploit prediction
0.69% chance of exploitation in the next 30 days, higher than 53% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| OSV | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | vyper | <0.3.8 |
0.3.8 |
Affected products
- vyperlang vyper
Classification
References
-
github.com
/vyperlang/vyper/commit/0bb7203b584e771b23536ba065a6efda457161bb
web, patch
-
github.com
/vyperlang/vyper/security/advisories/GHSA-6m97-7527-mh74
web, third-party-advisory, advisory
-
github.com
/vyperlang/vyper/blob/6020b8bbf66b062d299d87bc7e4eddc4c9d1c157/vyper/semantics/validation/data_positions.py#L1
web, product
-
nvd.nist.gov
/vuln/detail/CVE-2023-46247
advisory
-
github.com
/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2023-307.yaml
web
-
github.com
/vyperlang/vyper
package
Sources
- CVE List CVE-2023-46247
- GitHub Advisory GHSA-6m97-7527-mh74
- NVD CVE-2023-46247
- OSV PYSEC-2023-307
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.