mirror of https://github.com/crytic/slither
Merge pull request #2203 from vovikhangcdv/dev
update: improve unhandled initializers in unprotected-upgrade detectorpull/2473/head
commit
dde3378e74
@ -0,0 +1 @@ |
||||
AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol#11-14) |
@ -0,0 +1 @@ |
||||
Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Reinitializer.sol#11-14) |
@ -0,0 +1 @@ |
||||
AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/AnyInitializer.sol#11-14) |
@ -0,0 +1 @@ |
||||
Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol#11-14) |
@ -0,0 +1 @@ |
||||
AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol#11-14) |
@ -0,0 +1 @@ |
||||
Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol#11-14) |
@ -0,0 +1 @@ |
||||
AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/AnyInitializer.sol#11-14) |
@ -0,0 +1 @@ |
||||
Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Reinitializer.sol#11-14) |
@ -0,0 +1 @@ |
||||
AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol#11-14) |
@ -0,0 +1 @@ |
||||
Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol#11-14) |
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract AnyInitializer is Initializable { |
||||
address owner; |
||||
|
||||
function anyName() external initializer { |
||||
require(owner == address(0)); |
||||
owner = msg.sender; |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
@ -1,5 +1,9 @@ |
||||
contract Initializable{ |
||||
modifier initializer() { |
||||
_; |
||||
} |
||||
} |
||||
contract Initializable { |
||||
modifier initializer() { |
||||
_; |
||||
} |
||||
|
||||
modifier reinitializer(uint64 version) { |
||||
_; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract Reinitializer is Initializable { |
||||
address owner; |
||||
|
||||
function initialize() external reinitializer(2) { |
||||
require(owner == address(0)); |
||||
owner = msg.sender; |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract AnyInitializer is Initializable { |
||||
address payable owner; |
||||
|
||||
function anyName() external initializer { |
||||
require(owner == address(0)); |
||||
owner = msg.sender; |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
@ -1,5 +1,9 @@ |
||||
contract Initializable{ |
||||
modifier initializer() { |
||||
_; |
||||
} |
||||
} |
||||
contract Initializable { |
||||
modifier initializer() { |
||||
_; |
||||
} |
||||
|
||||
modifier reinitializer(uint64 version) { |
||||
_; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract Reinitializer is Initializable { |
||||
address payable owner; |
||||
|
||||
function initialize() external reinitializer(2) { |
||||
require(owner == address(0)); |
||||
owner = msg.sender; |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract AnyInitializer is Initializable { |
||||
address payable owner; |
||||
|
||||
function anyName() external initializer { |
||||
require(owner == address(0)); |
||||
owner = payable(msg.sender); |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
@ -1,5 +1,9 @@ |
||||
contract Initializable{ |
||||
modifier initializer() { |
||||
_; |
||||
} |
||||
} |
||||
contract Initializable { |
||||
modifier initializer() { |
||||
_; |
||||
} |
||||
|
||||
modifier reinitializer(uint64 version) { |
||||
_; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract Reinitializer is Initializable { |
||||
address payable owner; |
||||
|
||||
function initialize() external reinitializer(2) { |
||||
require(owner == address(0)); |
||||
owner = payable(msg.sender); |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract AnyInitializer is Initializable { |
||||
address payable owner; |
||||
|
||||
function anyName() external initializer { |
||||
require(owner == address(0)); |
||||
owner = payable(msg.sender); |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract Reinitializer is Initializable { |
||||
address payable owner; |
||||
|
||||
function initialize() external reinitializer(2) { |
||||
require(owner == address(0)); |
||||
owner = payable(msg.sender); |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract AnyInitializer is Initializable { |
||||
address payable owner; |
||||
|
||||
function anyName() external initializer { |
||||
require(owner == address(0)); |
||||
owner = payable(msg.sender); |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,15 @@ |
||||
import "./Initializable.sol"; |
||||
|
||||
contract Reinitializer is Initializable { |
||||
address payable owner; |
||||
|
||||
function initialize() external reinitializer(2) { |
||||
require(owner == address(0)); |
||||
owner = payable(msg.sender); |
||||
} |
||||
|
||||
function kill() external { |
||||
require(msg.sender == owner); |
||||
selfdestruct(owner); |
||||
} |
||||
} |
Binary file not shown.
Loading…
Reference in new issue