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.
328 lines
11 KiB
328 lines
11 KiB
{
|
|
"success": true,
|
|
"error": null,
|
|
"results": {
|
|
"detectors": [
|
|
{
|
|
"elements": [
|
|
{
|
|
"type": "function",
|
|
"name": "bug0",
|
|
"source_mapping": {
|
|
"start": 116,
|
|
"length": 60,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
9,
|
|
10,
|
|
11
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "TxOrigin",
|
|
"source_mapping": {
|
|
"start": 28,
|
|
"length": 393,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.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
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "bug0()"
|
|
}
|
|
},
|
|
{
|
|
"type": "node",
|
|
"name": "require(bool)(tx.origin == owner)",
|
|
"source_mapping": {
|
|
"start": 142,
|
|
"length": 27,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
10
|
|
],
|
|
"starting_column": 9,
|
|
"ending_column": 36
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "function",
|
|
"name": "bug0",
|
|
"source_mapping": {
|
|
"start": 116,
|
|
"length": 60,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
9,
|
|
10,
|
|
11
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "TxOrigin",
|
|
"source_mapping": {
|
|
"start": 28,
|
|
"length": 393,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.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
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "bug0()"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"description": "TxOrigin.bug0() (tests/tx_origin.sol#9-11) uses tx.origin for authorization: require(bool)(tx.origin == owner) (tests/tx_origin.sol#10)\n",
|
|
"markdown": "[TxOrigin.bug0()](tests/tx_origin.sol#L9-L11) uses tx.origin for authorization: [require(bool)(tx.origin == owner)](tests/tx_origin.sol#L10)\n",
|
|
"id": "ee75fdded0c273df2f7875bab74fc778ff8f0c85bbed968c80d5fd787bbef62e",
|
|
"check": "tx-origin",
|
|
"impact": "Medium",
|
|
"confidence": "Medium"
|
|
},
|
|
{
|
|
"elements": [
|
|
{
|
|
"type": "function",
|
|
"name": "bug2",
|
|
"source_mapping": {
|
|
"start": 182,
|
|
"length": 89,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
13,
|
|
14,
|
|
15,
|
|
16,
|
|
17
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "TxOrigin",
|
|
"source_mapping": {
|
|
"start": 28,
|
|
"length": 393,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.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
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "bug2()"
|
|
}
|
|
},
|
|
{
|
|
"type": "node",
|
|
"name": "tx.origin != owner",
|
|
"source_mapping": {
|
|
"start": 212,
|
|
"length": 18,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
14
|
|
],
|
|
"starting_column": 13,
|
|
"ending_column": 31
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "function",
|
|
"name": "bug2",
|
|
"source_mapping": {
|
|
"start": 182,
|
|
"length": 89,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.sol",
|
|
"is_dependency": false,
|
|
"lines": [
|
|
13,
|
|
14,
|
|
15,
|
|
16,
|
|
17
|
|
],
|
|
"starting_column": 5,
|
|
"ending_column": 6
|
|
},
|
|
"type_specific_fields": {
|
|
"parent": {
|
|
"type": "contract",
|
|
"name": "TxOrigin",
|
|
"source_mapping": {
|
|
"start": 28,
|
|
"length": 393,
|
|
"filename_used": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_relative": "tests/tx_origin.sol",
|
|
"filename_absolute": "/home/travis/build/crytic/slither/tests/tx_origin.sol",
|
|
"filename_short": "tests/tx_origin.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
|
|
],
|
|
"starting_column": 1,
|
|
"ending_column": 2
|
|
}
|
|
},
|
|
"signature": "bug2()"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"description": "TxOrigin.bug2() (tests/tx_origin.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/tx_origin.sol#14)\n",
|
|
"markdown": "[TxOrigin.bug2()](tests/tx_origin.sol#L13-L17) uses tx.origin for authorization: [tx.origin != owner](tests/tx_origin.sol#L14)\n",
|
|
"id": "76446f7e20ba58a5f2094d357d8982c01225c8f61d73f33ed98316c3a4e892f0",
|
|
"check": "tx-origin",
|
|
"impact": "Medium",
|
|
"confidence": "Medium"
|
|
}
|
|
]
|
|
}
|
|
} |