smartbugs-curated/dataset/access_control/phishable.sol

24 lines
486 B
Solidity
Raw Normal View History

/*
* @source: https://github.com/sigp/solidity-security-blog
* @author: -
* @vulnerable_at_lines: 20
*/
pragma solidity ^0.4.22;
contract Phishable {
address public owner;
constructor (address _owner) {
owner = _owner;
}
function () public payable {} // collect ether
function withdrawAll(address _recipient) public {
// <yes> <report> ACCESS_CONTROL
require(tx.origin == owner);
_recipient.transfer(this.balance);
}
}