Static Analyzer for Solidity
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.
 
 
 
 
slither/tests/detectors/controlled-array-length/array_length_assignment.sol...

604 lines
28 KiB

[
[
{
"elements": [
{
"type": "contract",
"name": "ArrayLengthAssignment",
"source_mapping": {
"start": 0,
"length": 1055,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
1,
2,
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
],
"starting_column": 1,
"ending_column": 2
}
},
{
"type": "node",
"name": "b.subStruct.x.length = param + 1",
"source_mapping": {
"start": 964,
"length": 32,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
41
],
"starting_column": 9,
"ending_column": 41
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "f",
"source_mapping": {
"start": 406,
"length": 647,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 5,
"ending_column": 6
},
"type_specific_fields": {
"parent": {
"type": "contract",
"name": "ArrayLengthAssignment",
"source_mapping": {
"start": 0,
"length": 1055,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
1,
2,
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
],
"starting_column": 1,
"ending_column": 2
}
},
"signature": "f(uint256,uint256)"
}
}
}
}
],
"description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- b.subStruct.x.length = param + 1 (tests/detectors/controlled-array-length/array_length_assignment.sol#41)\n",
"markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [b.subStruct.x.length = param + 1](tests/detectors/controlled-array-length/array_length_assignment.sol#L41)\n",
"id": "15164b2025ba6106829ae6e7baa9a73e931c0aa3e16a8d95ee30158667b4b7f5",
"check": "controlled-array-length",
"impact": "High",
"confidence": "Medium"
},
{
"elements": [
{
"type": "contract",
"name": "ArrayLengthAssignment",
"source_mapping": {
"start": 0,
"length": 1055,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
1,
2,
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
],
"starting_column": 1,
"ending_column": 2
}
},
{
"type": "node",
"name": "arr.length = param",
"source_mapping": {
"start": 527,
"length": 18,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
26
],
"starting_column": 13,
"ending_column": 31
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "f",
"source_mapping": {
"start": 406,
"length": 647,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 5,
"ending_column": 6
},
"type_specific_fields": {
"parent": {
"type": "contract",
"name": "ArrayLengthAssignment",
"source_mapping": {
"start": 0,
"length": 1055,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
1,
2,
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
],
"starting_column": 1,
"ending_column": 2
}
},
"signature": "f(uint256,uint256)"
}
}
}
}
],
"description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- arr.length = param (tests/detectors/controlled-array-length/array_length_assignment.sol#26)\n",
"markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [arr.length = param](tests/detectors/controlled-array-length/array_length_assignment.sol#L26)\n",
"id": "cb96ef1555863b421997853215ad3533faaffd35215987c6a2ebf21716d9bd1a",
"check": "controlled-array-length",
"impact": "High",
"confidence": "Medium"
},
{
"elements": [
{
"type": "contract",
"name": "ArrayLengthAssignment",
"source_mapping": {
"start": 0,
"length": 1055,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
1,
2,
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
],
"starting_column": 1,
"ending_column": 2
}
},
{
"type": "node",
"name": "a.x.length = param",
"source_mapping": {
"start": 818,
"length": 18,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
36
],
"starting_column": 9,
"ending_column": 27
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "f",
"source_mapping": {
"start": 406,
"length": 647,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 5,
"ending_column": 6
},
"type_specific_fields": {
"parent": {
"type": "contract",
"name": "ArrayLengthAssignment",
"source_mapping": {
"start": 0,
"length": 1055,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol",
"is_dependency": false,
"lines": [
1,
2,
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
],
"starting_column": 1,
"ending_column": 2
}
},
"signature": "f(uint256,uint256)"
}
}
}
}
],
"description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- a.x.length = param (tests/detectors/controlled-array-length/array_length_assignment.sol#36)\n",
"markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [a.x.length = param](tests/detectors/controlled-array-length/array_length_assignment.sol#L36)\n",
"id": "6a72386e40ef24dd02adf92179022559e26da5e66be4bb925d02756f90f38953",
"check": "controlled-array-length",
"impact": "High",
"confidence": "Medium"
}
]
]