Advisory

GHSA-4hg4-9mf5-wxxq

Also known as: CVE-2023-41052, PYSEC-2023-168

Summary

incorrect order of evaluation of side effects for some builtins

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2023-09-04 16:39 UTC
Modified
2026-09-17 19:30 UTC

Affected packages and fixes

vyper

PyPI · All systems

Affected

  • introduced 0, fixed 0.3.10 (ecosystem)

Fixed versions

0.3.10

Fix

  • Fixed version 0.3.10
    pip install --upgrade vyper==0.3.10

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences