{"id":"CVE-2023-41052","aliases":["CVE-2023-41052","GHSA-4hg4-9mf5-wxxq","PYSEC-2023-168"],"related":[],"kind":"vulnerability","state":"published","title":"Vyper: incorrect order of evaluation of side effects for some builtins","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nThe order of evaluation of the arguments of the builtin functions `uint256_addmod`, `uint256_mulmod`, `ecadd` and `ecmul` does not follow source order.\n• For `uint256_addmod(a,b,c)` and `uint256_mulmod(a,b,c)`, the order is `c,a,b`.\n• For `ecadd(a,b)` and `ecmul(a,b)`, the order is `b,a`.\n\nNote that this behaviour is problematic when the evaluation of one of the arguments produces side effects that other arguments depend on. \n\n### Patches\nhttps://github.com/vyperlang/vyper/pull/3583\n\n### Workarounds\nWhen 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2023-09-04T16:39:49.000Z","modified":"2026-09-17T19:30:05.529Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-670"],"affected":[{"ranges":[{"version":"<= 0.3.9","status":"affected"}],"vendor":"vyperlang","product":"vyper","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.3.10"}],"ecosystem":"PyPI","package":"vyper","purl":"pkg:pypi/vyper","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"0.3.9"}],"vendor":"vyperlang","product":"vyper","cpe":"cpe:2.3:a:vyperlang:vyper:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.3.10rc1"}],"ecosystem":"PyPI","package":"vyper","purl":"pkg:pypi/vyper","source":"pysec"}],"references":[{"url":"https://github.com/vyperlang/vyper/security/advisories/GHSA-4hg4-9mf5-wxxq","tags":["advisory","exploit","patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/vyperlang/vyper/pull/3583","tags":["fix","patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-41052","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vyperlang/vyper/commit/78fa8dd8f91ba0cb26277eeffb585c68c83e7daa","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2023-168.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vyperlang/vyper","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-26T18:04:38.192Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-41052","url":"https://www.cve.org/CVERecord?id=CVE-2023-41052","licence":"CVE Terms of Use","modified":"2024-09-26T18:30:33.353Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4hg4-9mf5-wxxq","url":"https://github.com/advisories/GHSA-4hg4-9mf5-wxxq","licence":"CC-BY-4.0","modified":"2026-09-17T19:30:05.529Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-41052","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-41052","licence":"Public domain","modified":"2026-06-17T06:20:18.937Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2023-168","url":"https://osv.dev/vulnerability/PYSEC-2023-168","licence":"CC-BY-4.0","modified":"2023-11-08T04:13:24.249Z"}],"updatedAt":"2026-11-25T22:58:27.584Z","epss":{"score":0.00536,"percentile":0.46629,"date":"2026-12-01T12:00:22.000Z"}}