Skip to main content

Vyper: Return inside for loop more than 1 level deep

0
Medium
Published: 10/06/2026 (10/06/2026, 15:20:10 UTC)
Source: GCVE Database
Product: vyper

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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Affected software

PyPIghsa
vyper
Affected versions
>=0.1.0b10 <0.2.3

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/06/2026, 16:48:50 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses