finding attack vector of CrossReentrancy is very Time-consuming
See original GitHub issueHi,
//SPDX-License-Identifier: MIT
pragma solidity ^0.4.0;
contract CrossReentrancy {
// INSECURE
mapping (address => uint) private userBalances;
function transfer(address to, uint amount) public {
if (userBalances[msg.sender] >= amount) {
userBalances[to] += amount;
userBalances[msg.sender] -= amount;
}
}
function withdrawBalance() public {
uint amountToWithdraw = userBalances[msg.sender];
// <yes> <report> REENTRANCY
(bool success, ) = msg.sender.call.value(amountToWithdraw)(""); // At this point, the caller's code is executed, and can call transfer()
require(success);
userBalances[msg.sender] = 0;
}
function deposit() public payable{
userBalances[msg.sender]+=msg.value;
}
}
myth version 0.42 (last version)
Issue Analytics
- State:
- Created a year ago
- Comments:42
Top Results From Across the Web
Smart contract development: Common mistakes to avoid
Learn about common smart contract development mistakes to avoid to protect contracts from attacks and prevent monetary loss.
Read more >Bringing 'Clarity' to 8 Dangerous Smart Contract ...
Highlighting Some Of The Most Common Smart Contract Vulnerabilities And How Clarity ... Clarity: Clarity doesn't allow reentrancy, period.
Read more >Sereum: Protecting Existing Smart Contracts Against Re- ...
Re-entrancy attacks emerge as one of the most severe and effective attack vectors against smart contracts. Re-entrancy of a contract occurs when a...
Read more >Protect Your Solidity Smart Contracts From Reentrancy ...
These attacks are harder to detect. A cross-function reentrancy attack is possible when a vulnerable function shares state with another function ...
Read more >DeFi Deep Dive - Explaining DeFi Attack Vectors and ...
Reentrancy attacks depend on unsafe External Calls. And since every call that is not an Internal Call can be classified as an External...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @emretepedev, This is the expected behavior, as it should take quite some time to run on such contracts. Mythril is a symbolic execution engine, it translates bytecode into SMT queries to check for issues, these SMT queries are usually complex to solve, hence the time.
Hi, I solve the problem. the Mythril wasn’t installed entirely and a few packages have been broken. 😃 / thank you @norhh