Vyper: Return inside for loop more than 1 level deep
Description
A vulnerability in Vyper versions from 0.1.0b10 up to but not including 0.2.3 causes a transaction revert when a return statement is used inside a for loop nested more than one level deep in internal calls. This results in an invalid jump destination and a stack underflow error. The impact is minor and mainly causes unnecessary transaction reverts, but under certain conditions, it could lead to a denial-of-service (DoS) on public contracts. The issue is fixed in Vyper 0.2.3.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises when a return statement is executed inside a for loop nested more than one level deep within internal function calls in Vyper smart contracts. This triggers an invalid jump destination error, causing the transaction to revert unnecessarily due to a stack underflow. The problem was responsibly disclosed and affects Vyper versions from 0.1.0b10 up to but excluding 0.2.3. The fix was implemented in Vyper 0.2.3. A workaround is to avoid returning inside such nested for loops.
Potential Impact
The impact is limited to causing transaction reverts due to invalid jump destinations when return statements are used inside nested for loops in internal calls. This can lead to denial-of-service conditions in public contracts under specific scenarios. However, the issue is unlikely to be encountered without nested calls and return statements inside loops, and reverts should be noticeable during testing.
Mitigation Recommendations
Upgrade to Vyper version 0.2.3 or later, where this issue is fixed. Alternatively, avoid using return statements inside for loops nested more than one level deep in internal calls as a workaround.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-vg88-3v92-rjx2
- Osv Schema Version
- 1.4.0
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 4.0
Threat ID: 6ac523782cdf04f656c4bf5d
Added to database: 10/06/2026, 16:36:08 UTC
Last enriched: 10/06/2026, 16:48:50 UTC
Last updated: 10/06/2026, 16:48:50 UTC
Views: 11
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.