CVE-2023-30629

7.5 HIGH

📋 TL;DR

The Vyper compiler generates incorrect bytecode for contracts using raw_call with revert_on_failure=False and max_outsize=0, causing unpredictable boolean return values. This affects all smart contracts compiled with Vyper versions 0.3.1 through 0.3.7 that use this specific raw_call configuration.

💻 Affected Systems

Products:
  • Vyper compiler
Versions: 0.3.1 through 0.3.7
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects contracts using raw_call with revert_on_failure=False and max_outsize=0 parameters.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Smart contracts could execute unintended logic based on incorrect boolean values from raw_call, potentially leading to unauthorized fund transfers, contract state corruption, or denial of service.

🟠

Likely Case

Contracts may behave unpredictably when processing raw_call results, causing transaction failures or incorrect state changes depending on memory garbage values.

🟢

If Mitigated

With proper input validation and workarounds, contracts can avoid the vulnerable configuration and maintain expected behavior.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation depends on contract logic that relies on raw_call return values. The vulnerability is deterministic based on compiler behavior.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.3.8

Vendor Advisory: https://github.com/vyperlang/vyper/security/advisories/GHSA-w9g2-3w7p-72g9

Restart Required: No

Instructions:

1. Upgrade Vyper compiler to version 0.3.8 or later. 2. Recompile all affected smart contracts with the patched compiler. 3. Redeploy recompiled contracts to blockchain networks.

🔧 Temporary Workarounds

Modify raw_call parameters

all

Change max_outsize parameter to be greater than 0 in all raw_call invocations with revert_on_failure=False

Modify contract source: raw_call(target, data, gas=gas, revert_on_failure=False, max_outsize=1)

🧯 If You Can't Patch

  • Audit all contracts for raw_call usage with revert_on_failure=False and max_outsize=0
  • Implement additional validation logic to handle unexpected boolean return values from raw_call

🔍 How to Verify

Check if Vulnerable:

Check Vyper compiler version with 'vyper --version'. If version is between 0.3.1 and 0.3.7 inclusive, and contracts use raw_call with revert_on_failure=False and max_outsize=0, they are vulnerable.

Check Version:

vyper --version

Verify Fix Applied:

After upgrading to 0.3.8+, recompile contracts and verify bytecode differs from previous compilation. Test raw_call behavior with the problematic parameter combination.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected contract behavior when raw_call returns True/False
  • Transaction reversals related to external call processing

Network Indicators:

  • Unusual contract interactions involving raw_call patterns
  • Failed transactions to contracts using vulnerable Vyper versions

SIEM Query:

Not applicable for blockchain environments

🔗 References

📤 Share & Export