{"id":"CVE-2021-48018","kind":"vulnerability","aliases":["CVE-2021-48018"],"related":[],"title":"Vyper: reentrancy lock storage slots overwrite contract state variables","description":"Vyper from 0.2.13 before 0.2.15 allocates storage slots for @nonreentrant reentrancy locks at the same locations as contract storage variables. When a function using @nonreentrant is called, setting the lock overwrites the overlapping storage variable, corrupting contract state and breaking the contract's intended logic.","summary":"Vyper versions 0.2.13 before 0.2.15 place @nonreentrant lock storage slots on the same locations as ordinary contract storage variables. Calling a function marked @nonreentrant overwrites the overlapping variable, corrupting contract state and breaking its logic.","severity":"high","cvss":8.3,"epss":0.00321,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["ethereum","package","smart-contracts","vyper"],"not_affected_if":["compiled-with-vyper-0.2.15-or-later","no-nonreentrant-usage"],"how_to_check":"- Check the Vyper compiler version with `vyper --version` or in the project's requirements or lockfile.\n- Search deployed or source contracts for `@nonreentrant` usage with `grep -rn \"@nonreentrant\" contracts/`.","fix":"- Upgrade the Vyper compiler to `0.2.15` or later and recompile every contract that uses `@nonreentrant`.\n- Redeploy affected contracts, since the bytecode layout of already-deployed contracts cannot be changed in place.","status":"open","published_at":"2026-10-21T01:17:18+00:00","first_seen_at":"2026-10-23T21:57:27+00:00","triaged_at":"2026-10-25T03:02:19+00:00","updated_at":"2026-10-25T03:02:19+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-10-25T03:02:19Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade the Vyper compiler to `0.2.15` or later and recompile every contract that uses `@nonreentrant`.\n- Redeploy affected contracts, since the bytecode layout of already-deployed contracts cannot be changed in place.","reach":"internet","title":"Vyper: reentrancy lock storage slots overwrite contract state variables","impact":"high","summary":"Vyper versions 0.2.13 before 0.2.15 place @nonreentrant lock storage slots on the same locations as ordinary contract storage variables. Calling a function marked @nonreentrant overwrites the overlapping variable, corrupting contract state and breaking its logic.","category":"package","nicknames":[],"who_cares":["vyper","smart-contracts","ethereum"],"confidence":0.7,"needs_auth":"no","worst_case":"contract state corrupted, breaking intended contract logic and funds handling","analyst_note":"","how_to_check":"- Check the Vyper compiler version with `vyper --version` or in the project's requirements or lockfile.\n- Search deployed or source contracts for `@nonreentrant` usage with `grep -rn \"@nonreentrant\" contracts/`.","needs_analyst":false,"not_affected_if":["compiled-with-vyper-0.2.15-or-later","no-nonreentrant-usage"],"who_is_affected":"Teams that compile Vyper contracts with the affected compiler range and use `@nonreentrant` on functions, because the lock slot can collide with a state variable. Contracts compiled with Vyper outside 0.2.13 to 0.2.15, or that do not use `@nonreentrant`, are not affected.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000643,"input_tokens":3376,"output_tokens":610,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-2021':11A,14A '-48018':12A,15A '0.2.13':24B,59C '0.2.15':26B,61C 'alloc':62C 'break':54B,96C 'call':41B,83C 'contract':7A,20B,38B,51B,74C,93C,98C 'corrupt':50B,92C 'cve':10A,13A 'ethereum':16B 'function':43B,79C 'intend':100C 'locat':35B,72C 'lock':3A,29B,68C,86C 'logic':56B,101C 'mark':44B 'nonreentr':28B,45B,66C,81C 'ordinari':37B 'overlap':48B,89C 'overwrit':6A,46B,87C 'packag':17B 'place':27B 'reentranc':2A,67C 'set':84C 'slot':5A,31B,64C 'smart':19B 'smart-contract':18B 'state':8A,52B,94C 'storag':4A,30B,39B,63C,75C,90C 'use':80C 'variabl':9A,40B,49B,76C,91C 'version':23B 'vyper':1A,21B,22B,57C","nicknames":[],"mitigations":[],"who_affected":"Teams that compile Vyper contracts with the affected compiler range and use `@nonreentrant` on functions, because the lock slot can collide with a state variable. Contracts compiled with Vyper outside 0.2.13 to 0.2.15, or that do not use `@nonreentrant`, are not affected.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-21T01:17:18+00:00","kev":null,"cvss_vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"disclosure@vulncheck.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2021-48018","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-48018","severity":null,"published_at":"2026-10-21T01:17:18+00:00","modified_at":"2026-10-23T15:17:20+00:00","first_seen_at":"2026-10-23T21:57:27+00:00","fetched_at":"2026-10-23T22:29:01+00:00","note":null},{"source":"epss","external_id":"CVE-2021-48018","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-48018","severity":null,"published_at":null,"modified_at":null,"first_seen_at":"2026-10-24T13:15:55+00:00","fetched_at":"2026-10-24T13:15:55+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}