mirror of https://github.com/crytic/slither
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
713 lines
24 KiB
713 lines
24 KiB
{
|
|
"success": true,
|
|
"error": null,
|
|
"results": {
|
|
"detectors": [
|
|
{
|
|
"elements": [
|
|
{
|
|
"type": "function",
|
|
"name": "withdrawBalance",
|
|
"source_mapping": {
|
|
"start": 298,
|
|
"length": 357,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "Reentrancy",
|
|
"source_mapping": {
|
|
"start": 25,
|
|
"length": 1807,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
3,
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
8,
|
|
9,
|
|
10,
|
|
11,
|
|
12,
|
|
13,
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22,
|
|
23,
|
|
24,
|
|
25,
|
|
26,
|
|
27,
|
|
28,
|
|
29,
|
|
30,
|
|
31,
|
|
32,
|
|
33,
|
|
34,
|
|
35,
|
|
36,
|
|
37,
|
|
38,
|
|
39,
|
|
40,
|
|
41,
|
|
42,
|
|
43,
|
|
44,
|
|
45,
|
|
46,
|
|
47,
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
52,
|
|
53,
|
|
54
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "withdrawBalance()"
|
|
}
|
|
},
|
|
{
|
|
"type": "node",
|
|
"name": "(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()",
|
|
"source_mapping": {
|
|
"start": 477,
|
|
"length": 81,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
17
|
|
],
|
|
"starting_column": 9,
|
|
"ending_column": 90
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "function",
|
|
"name": "withdrawBalance",
|
|
"source_mapping": {
|
|
"start": 298,
|
|
"length": 357,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "Reentrancy",
|
|
"source_mapping": {
|
|
"start": 25,
|
|
"length": 1807,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
3,
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
8,
|
|
9,
|
|
10,
|
|
11,
|
|
12,
|
|
13,
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22,
|
|
23,
|
|
24,
|
|
25,
|
|
26,
|
|
27,
|
|
28,
|
|
29,
|
|
30,
|
|
31,
|
|
32,
|
|
33,
|
|
34,
|
|
35,
|
|
36,
|
|
37,
|
|
38,
|
|
39,
|
|
40,
|
|
41,
|
|
42,
|
|
43,
|
|
44,
|
|
45,
|
|
46,
|
|
47,
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
52,
|
|
53,
|
|
54
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "withdrawBalance()"
|
|
}
|
|
}
|
|
},
|
|
"additional_fields": {
|
|
"underlying_type": "external_calls"
|
|
}
|
|
},
|
|
{
|
|
"type": "node",
|
|
"name": "userBalance[msg.sender] = 0",
|
|
"source_mapping": {
|
|
"start": 621,
|
|
"length": 27,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
21
|
|
],
|
|
"starting_column": 9,
|
|
"ending_column": 36
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "function",
|
|
"name": "withdrawBalance",
|
|
"source_mapping": {
|
|
"start": 298,
|
|
"length": 357,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "Reentrancy",
|
|
"source_mapping": {
|
|
"start": 25,
|
|
"length": 1807,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
3,
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
8,
|
|
9,
|
|
10,
|
|
11,
|
|
12,
|
|
13,
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22,
|
|
23,
|
|
24,
|
|
25,
|
|
26,
|
|
27,
|
|
28,
|
|
29,
|
|
30,
|
|
31,
|
|
32,
|
|
33,
|
|
34,
|
|
35,
|
|
36,
|
|
37,
|
|
38,
|
|
39,
|
|
40,
|
|
41,
|
|
42,
|
|
43,
|
|
44,
|
|
45,
|
|
46,
|
|
47,
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
52,
|
|
53,
|
|
54
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "withdrawBalance()"
|
|
}
|
|
}
|
|
},
|
|
"additional_fields": {
|
|
"underlying_type": "variables_written",
|
|
"variable_name": "userBalance"
|
|
}
|
|
}
|
|
],
|
|
"description": "Reentrancy in Reentrancy.withdrawBalance() (tests/reentrancy-0.5.1.sol#14-22):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(userBalance[msg.sender])() (tests/reentrancy-0.5.1.sol#17)\n\tState variables written after the call(s):\n\t- Reentrancy.userBalance (tests/reentrancy-0.5.1.sol#4) in userBalance[msg.sender] = 0 (tests/reentrancy-0.5.1.sol#21)\n",
|
|
"markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/reentrancy-0.5.1.sol#L14-L22):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()](tests/reentrancy-0.5.1.sol#L17)\n\tState variables written after the call(s):\n\t- [Reentrancy.userBalance](tests/reentrancy-0.5.1.sol#L4) in [userBalance[msg.sender] = 0](tests/reentrancy-0.5.1.sol#L21)\n",
|
|
"id": "90119c12446a44e514bb4ccd7a0e869f210d7c3ec349d24d4237ace685a75df9",
|
|
"check": "reentrancy-eth",
|
|
"impact": "High",
|
|
"confidence": "Medium"
|
|
},
|
|
{
|
|
"elements": [
|
|
{
|
|
"type": "function",
|
|
"name": "withdrawBalance_fixed_3",
|
|
"source_mapping": {
|
|
"start": 1434,
|
|
"length": 393,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
44,
|
|
45,
|
|
46,
|
|
47,
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
52,
|
|
53
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "Reentrancy",
|
|
"source_mapping": {
|
|
"start": 25,
|
|
"length": 1807,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
3,
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
8,
|
|
9,
|
|
10,
|
|
11,
|
|
12,
|
|
13,
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22,
|
|
23,
|
|
24,
|
|
25,
|
|
26,
|
|
27,
|
|
28,
|
|
29,
|
|
30,
|
|
31,
|
|
32,
|
|
33,
|
|
34,
|
|
35,
|
|
36,
|
|
37,
|
|
38,
|
|
39,
|
|
40,
|
|
41,
|
|
42,
|
|
43,
|
|
44,
|
|
45,
|
|
46,
|
|
47,
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
52,
|
|
53,
|
|
54
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "withdrawBalance_fixed_3()"
|
|
}
|
|
},
|
|
{
|
|
"type": "node",
|
|
"name": "(ret,mem) = msg.sender.call.value(amount)()",
|
|
"source_mapping": {
|
|
"start": 1679,
|
|
"length": 64,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
49
|
|
],
|
|
"starting_column": 9,
|
|
"ending_column": 73
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "function",
|
|
"name": "withdrawBalance_fixed_3",
|
|
"source_mapping": {
|
|
"start": 1434,
|
|
"length": 393,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
44,
|
|
45,
|
|
46,
|
|
47,
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
52,
|
|
53
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "Reentrancy",
|
|
"source_mapping": {
|
|
"start": 25,
|
|
"length": 1807,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
3,
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
8,
|
|
9,
|
|
10,
|
|
11,
|
|
12,
|
|
13,
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22,
|
|
23,
|
|
24,
|
|
25,
|
|
26,
|
|
27,
|
|
28,
|
|
29,
|
|
30,
|
|
31,
|
|
32,
|
|
33,
|
|
34,
|
|
35,
|
|
36,
|
|
37,
|
|
38,
|
|
39,
|
|
40,
|
|
41,
|
|
42,
|
|
43,
|
|
44,
|
|
45,
|
|
46,
|
|
47,
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
52,
|
|
53,
|
|
54
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "withdrawBalance_fixed_3()"
|
|
}
|
|
}
|
|
},
|
|
"additional_fields": {
|
|
"underlying_type": "external_calls"
|
|
}
|
|
},
|
|
{
|
|
"type": "node",
|
|
"name": "userBalance[msg.sender] = amount",
|
|
"source_mapping": {
|
|
"start": 1778,
|
|
"length": 32,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
51
|
|
],
|
|
"starting_column": 13,
|
|
"ending_column": 45
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "function",
|
|
"name": "withdrawBalance_fixed_3",
|
|
"source_mapping": {
|
|
"start": 1434,
|
|
"length": 393,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
44,
|
|
45,
|
|
46,
|
|
47,
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
52,
|
|
53
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "Reentrancy",
|
|
"source_mapping": {
|
|
"start": 25,
|
|
"length": 1807,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_relative": "tests/reentrancy-0.5.1.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/reentrancy-0.5.1.sol",
|
|
"filename_short": "tests/reentrancy-0.5.1.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
3,
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
8,
|
|
9,
|
|
10,
|
|
11,
|
|
12,
|
|
13,
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22,
|
|
23,
|
|
24,
|
|
25,
|
|
26,
|
|
27,
|
|
28,
|
|
29,
|
|
30,
|
|
31,
|
|
32,
|
|
33,
|
|
34,
|
|
35,
|
|
36,
|
|
37,
|
|
38,
|
|
39,
|
|
40,
|
|
41,
|
|
42,
|
|
43,
|
|
44,
|
|
45,
|
|
46,
|
|
47,
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
52,
|
|
53,
|
|
54
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "withdrawBalance_fixed_3()"
|
|
}
|
|
}
|
|
},
|
|
"additional_fields": {
|
|
"underlying_type": "variables_written",
|
|
"variable_name": "userBalance"
|
|
}
|
|
}
|
|
],
|
|
"description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/reentrancy-0.5.1.sol#44-53):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(amount)() (tests/reentrancy-0.5.1.sol#49)\n\tState variables written after the call(s):\n\t- Reentrancy.userBalance (tests/reentrancy-0.5.1.sol#4) in userBalance[msg.sender] = amount (tests/reentrancy-0.5.1.sol#51)\n",
|
|
"markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/reentrancy-0.5.1.sol#L44-L53):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(amount)()](tests/reentrancy-0.5.1.sol#L49)\n\tState variables written after the call(s):\n\t- [Reentrancy.userBalance](tests/reentrancy-0.5.1.sol#L4) in [userBalance[msg.sender] = amount](tests/reentrancy-0.5.1.sol#L51)\n",
|
|
"id": "048dce6132290bdee94cd1e52c330873fed4b1c9ad2f49df4ba3d6ef49266a41",
|
|
"check": "reentrancy-eth",
|
|
"impact": "High",
|
|
"confidence": "Medium"
|
|
}
|
|
]
|
|
}
|
|
} |