CVE-2023-41052: Vyper: incorrect order of evaluation of side effects for some builtins

Published Sep 4, 2023
·
Updated

Impact The order of evaluation of the arguments of the builtin functions uint256addmod, uint256mulmod, ecadd and ecmul does not follow source order. • For uint256addmod(a,b,c) and uint256mulmod(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.

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

Other sources

Vyper is a Pythonic Smart Contract Language. In affected versions the order of evaluation of the arguments of the builtin functions uint256addmod, uint256mulmod, 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.

— MITRE

Affected Software

2 affected componentsFixes available
pip/vyper<=0.3.9
0.3.10rc1
vyperlang Vyper Python<=0.3.9

Event History

Sep 4, 2023
Advisory Published
04:39 PM
CVE Published
via MITRE·05:36 PM
Data Sourced
via MITRE·05:36 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is CVE-2023-41052?

CVE-2023-41052 is a vulnerability in the Vyper smart contract language where the order of evaluation of certain builtin functions does not follow source order.

2

What is the impact of CVE-2023-41052?

The impact of CVE-2023-41052 is that the order of evaluation for certain builtin functions in Vyper is inconsistent, which can lead to unexpected behavior or vulnerabilities in smart contracts.

3

How can I fix CVE-2023-41052?

To fix CVE-2023-41052, update to Vyper version 0.3.10 or later.

4

What is the severity of CVE-2023-41052?

CVE-2023-41052 has a severity rating of 5.3, which is considered medium severity.

5

What is the CWE ID of CVE-2023-41052?

The CWE ID of CVE-2023-41052 is 670.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203