3.7low
Vyper: incorrect order of evaluation of side effects for some builtins
- Severity
- 3.7low CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.54% (higher than 46% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-4hg4-9mf5-wxxqPYSEC-2023-168
Description
Vyper is a Pythonic Smart Contract Language. In affected versions the order of evaluation of the arguments of the builtin functions `uint256_addmod`, `uint256_mulmod`, `ecadd` and `ecmul` does not follow source order. This behaviour is problematic when the evaluation of one of the arguments produces side effects that other arguments depend on. A patch is currently being developed on pull request #3583. When using builtins from the list above, users should make sure that the arguments of the expression do not produce side effects or, if one does, that no other argument is dependent on those side effects.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| vyperlang vyper | <= 0.3.9, up to 0.3.9 | CVE List, NVD |
| vyper (PyPI) | before 0.3.10, before 0.3.10rc1 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 3.7low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| PyPA Advisory Database | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
Vyper is a Pythonic Smart Contract Language. In affected versions the order of evaluation of the arguments of the builtin functions `uint256_addmod`, `uint256_mulmod`, `ecadd` and `ecmul` does not follow source order. This behaviour is problematic when the evaluation of one of the arguments produces side effects that other arguments depend on. A patch is currently being developed on pull request #3583. When using builtins from the list above, users should make sure that the arguments of the expression do not produce side effects or, if one does, that no other argument is dependent on those side effects.
GitHub Advisory Database
Impact
The order of evaluation of the arguments of the builtin functions uint256_addmod, uint256_mulmod, ecadd and ecmul does not follow source order.
• For uint256_addmod(a,b,c) and uint256_mulmod(a,b,c), the order is c,a,b.
• For ecadd(a,b) and ecmul(a,b), the order is b,a.
Note that this behaviour is problematic when the evaluation of one of the arguments produces side effects that other arguments depend on.
Patches
https://github.com/vyperlang/vyper/pull/3583
Workarounds
When using builtins from the list above, make sure that the arguments of the expression do not produce side effects or, if one does, that no other argument is dependent on those side effects.
NVD (es)
Vyper es un Lenguaje de Contrato Inteligente de Python. En las versiones afectadas, el orden de evaluación de los argumentos de las funciones integradas `uint256_addmod`, `uint256_mulmod`, `ecadd` and `ecmul` no sigue el orden de origen. Este comportamiento es problemático cuando la evaluación de uno de los argumentos produce efectos secundarios de los que dependen otros argumentos. Actualmente se está desarrollando un parche mediante la solicitud de extracción #3583. Al utilizar elementos integrados de la lista anterior, los usuarios deben asegurarse de que los argumentos de la expresión no produzcan efectos secundarios o, si los produce, que ningún otro argumento dependa de esos efectos secundarios.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-41052 changed 2024-09-26 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4hg4-9mf5-wxxq changed 2026-09-17 | CC-BY-4.0 |
| NVD | CVE-2023-41052 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2023-168 changed 2023-11-08 | CC-BY-4.0 |