From dc09c2e94f50f7c4cea437bb78433d690434f241 Mon Sep 17 00:00:00 2001
From: Nikhil Parasaram
Date: Sat, 27 Oct 2018 13:19:15 +0530
Subject: [PATCH] Change the issue description
---
mythril/analysis/modules/ether_send.py | 8 +-
mythril/analysis/modules/exceptions.py | 3 +-
mythril/analysis/modules/integer.py | 12 +-
mythril/analysis/modules/multiple_sends.py | 2 +-
mythril/analysis/modules/suicide.py | 5 +-
.../modules/transaction_order_dependence.py | 6 +-
tests/cmd_line_test.py | 3 +-
.../outputs_expected/calls.sol.o.graph.html | 10 +-
.../outputs_expected/calls.sol.o.json | 2 +-
.../outputs_expected/calls.sol.o.markdown | 2 +-
.../outputs_expected/calls.sol.o.text | 2 +-
.../environments.sol.o.graph.html | 10 +-
.../outputs_expected/environments.sol.o.json | 2 +-
.../environments.sol.o.markdown | 9 +-
.../outputs_expected/environments.sol.o.text | 12 +-
.../ether_send.sol.o.graph.html | 10 +-
.../outputs_expected/ether_send.sol.o.json | 2 +-
.../ether_send.sol.o.markdown | 5 +-
.../outputs_expected/ether_send.sol.o.text | 6 +-
.../exceptions.sol.o.graph.html | 10 +-
.../outputs_expected/exceptions.sol.o.json | 2 +-
.../exceptions.sol.o.markdown | 8 +-
.../outputs_expected/exceptions.sol.o.text | 8 +-
.../kinds_of_calls.sol.o.graph.html | 10 +-
.../metacoin.sol.o.graph.html | 10 +-
.../multi_contracts.sol.o.graph.html | 10 +-
.../multi_contracts.sol.o.json | 2 +-
.../multi_contracts.sol.o.markdown | 2 +-
.../multi_contracts.sol.o.text | 2 +-
.../nonascii.sol.o.graph.html | 10 +-
.../outputs_expected/origin.sol.o.graph.html | 10 +-
.../outputs_expected/origin.sol.o.json | 2 +-
.../outputs_current/calls.sol.o.easm | 400 ++++++++++++++++
.../outputs_current/calls.sol.o.graph.html | 62 +++
.../outputs_current/calls.sol.o.json | 1 +
.../outputs_current/calls.sol.o.markdown | 111 +++++
.../outputs_current/calls.sol.o.text | 90 ++++
.../outputs_current/environments.sol.o.easm | 259 +++++++++++
.../environments.sol.o.graph.html | 62 +++
.../outputs_current/environments.sol.o.json | 1 +
.../environments.sol.o.markdown | 34 ++
.../outputs_current/environments.sol.o.text | 30 ++
.../outputs_current/ether_send.sol.o.easm | 420 +++++++++++++++++
.../ether_send.sol.o.graph.html | 62 +++
.../outputs_current/ether_send.sol.o.json | 1 +
.../outputs_current/ether_send.sol.o.markdown | 25 +
.../outputs_current/ether_send.sol.o.text | 21 +
.../outputs_current/exceptions.sol.o.easm | 392 ++++++++++++++++
.../exceptions.sol.o.graph.html | 62 +++
.../outputs_current/exceptions.sol.o.json | 1 +
.../outputs_current/exceptions.sol.o.markdown | 45 ++
.../outputs_current/exceptions.sol.o.text | 36 ++
.../outputs_current/kinds_of_calls.sol.o.easm | 435 ++++++++++++++++++
.../kinds_of_calls.sol.o.graph.html | 62 +++
.../outputs_current/kinds_of_calls.sol.o.json | 1 +
.../kinds_of_calls.sol.o.markdown | 45 ++
.../outputs_current/kinds_of_calls.sol.o.text | 36 ++
.../outputs_current/metacoin.sol.o.easm | 253 ++++++++++
.../outputs_current/metacoin.sol.o.graph.html | 62 +++
.../outputs_current/metacoin.sol.o.json | 1 +
.../outputs_current/metacoin.sol.o.markdown | 3 +
.../outputs_current/metacoin.sol.o.text | 1 +
.../multi_contracts.sol.o.easm | 77 ++++
.../multi_contracts.sol.o.graph.html | 62 +++
.../multi_contracts.sol.o.json | 1 +
.../multi_contracts.sol.o.markdown | 13 +
.../multi_contracts.sol.o.text | 10 +
.../outputs_current/nonascii.sol.o.easm | 167 +++++++
.../outputs_current/nonascii.sol.o.graph.html | 62 +++
.../outputs_current/nonascii.sol.o.json | 1 +
.../outputs_current/nonascii.sol.o.markdown | 3 +
.../outputs_current/nonascii.sol.o.text | 1 +
.../outputs_current/origin.sol.o.easm | 168 +++++++
.../outputs_current/origin.sol.o.graph.html | 62 +++
.../outputs_current/origin.sol.o.json | 1 +
.../outputs_current/origin.sol.o.markdown | 13 +
.../outputs_current/origin.sol.o.text | 10 +
.../outputs_current/overflow.sol.o.easm | 388 ++++++++++++++++
.../outputs_current/overflow.sol.o.graph.html | 62 +++
.../outputs_current/overflow.sol.o.json | 1 +
.../outputs_current/overflow.sol.o.markdown | 34 ++
.../outputs_current/overflow.sol.o.text | 30 ++
.../outputs_current/returnvalue.sol.o.easm | 129 ++++++
.../returnvalue.sol.o.graph.html | 62 +++
.../outputs_current/returnvalue.sol.o.json | 1 +
.../returnvalue.sol.o.markdown | 34 ++
.../outputs_current/returnvalue.sol.o.text | 27 ++
.../outputs_current/suicide.sol.o.easm | 58 +++
.../outputs_current/suicide.sol.o.graph.html | 62 +++
.../outputs_current/suicide.sol.o.json | 1 +
.../outputs_current/suicide.sol.o.markdown | 12 +
.../outputs_current/suicide.sol.o.text | 10 +
.../outputs_current/underflow.sol.o.easm | 365 +++++++++++++++
.../underflow.sol.o.graph.html | 62 +++
.../outputs_current/underflow.sol.o.json | 1 +
.../outputs_current/underflow.sol.o.markdown | 34 ++
.../outputs_current/underflow.sol.o.text | 30 ++
.../overflow.sol.o.graph.html | 10 +-
.../outputs_expected/overflow.sol.o.json | 2 +-
.../outputs_expected/overflow.sol.o.markdown | 9 +-
.../outputs_expected/overflow.sol.o.text | 12 +-
.../returnvalue.sol.o.graph.html | 10 +-
.../outputs_expected/suicide.sol.o.graph.html | 10 +-
.../outputs_expected/suicide.sol.o.json | 2 +-
.../outputs_expected/suicide.sol.o.markdown | 2 +-
.../outputs_expected/suicide.sol.o.text | 2 +-
.../underflow.sol.o.graph.html | 10 +-
.../outputs_expected/underflow.sol.o.json | 2 +-
.../outputs_expected/underflow.sol.o.markdown | 9 +-
.../outputs_expected/underflow.sol.o.text | 12 +-
110 files changed, 5228 insertions(+), 129 deletions(-)
create mode 100644 tests/testdata/outputs_expected/outputs_current/calls.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/calls.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/calls.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/calls.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/calls.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/environments.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/environments.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/environments.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/environments.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/environments.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/origin.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/origin.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/origin.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/origin.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/origin.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/overflow.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/overflow.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/overflow.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/overflow.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/overflow.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/suicide.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/suicide.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/suicide.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/suicide.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/suicide.sol.o.text
create mode 100644 tests/testdata/outputs_expected/outputs_current/underflow.sol.o.easm
create mode 100644 tests/testdata/outputs_expected/outputs_current/underflow.sol.o.graph.html
create mode 100644 tests/testdata/outputs_expected/outputs_current/underflow.sol.o.json
create mode 100644 tests/testdata/outputs_expected/outputs_current/underflow.sol.o.markdown
create mode 100644 tests/testdata/outputs_expected/outputs_current/underflow.sol.o.text
diff --git a/mythril/analysis/modules/ether_send.py b/mythril/analysis/modules/ether_send.py
index 71131038..76e96a46 100644
--- a/mythril/analysis/modules/ether_send.py
+++ b/mythril/analysis/modules/ether_send.py
@@ -39,14 +39,14 @@ def execute(statespace):
interesting = False
- description = "In the function `" + call.node.function_name + "` "
+ description = "A non-zero amount of Ether is sent to a user-supplied address."
if re.search(r"caller", str(call.to)):
- description += "a non-zero amount of Ether is sent to msg.sender.\n"
+ description += " The target address is msg.sender.\n"
interesting = True
elif re.search(r"calldata", str(call.to)):
- description += "a non-zero amount of Ether is sent to an address taken from function arguments.\n"
+ description += " The target address is taken from function arguments.\n"
interesting = True
else:
@@ -56,7 +56,7 @@ def execute(statespace):
idx = m.group(1)
description += (
- "a non-zero amount of Ether is sent to an address taken from storage slot "
+ " The target address is taken from storage slot "
+ str(idx)
+ ".\n"
)
diff --git a/mythril/analysis/modules/exceptions.py b/mythril/analysis/modules/exceptions.py
index d27e1729..f1702abf 100644
--- a/mythril/analysis/modules/exceptions.py
+++ b/mythril/analysis/modules/exceptions.py
@@ -36,8 +36,7 @@ def execute(statespace):
"out-of-bounds array access, or assert violations. "
)
description += (
- "This is acceptable in most situations. "
- "Note however that `assert()` should only be used to check invariants. "
+ "Note that explicit `assert()` should only be used to check invariants. "
"Use `require()` for regular input checking. "
)
diff --git a/mythril/analysis/modules/integer.py b/mythril/analysis/modules/integer.py
index 3b373926..c6f02936 100644
--- a/mythril/analysis/modules/integer.py
+++ b/mythril/analysis/modules/integer.py
@@ -99,12 +99,7 @@ def _check_integer_overflow(statespace, state, node):
_type="Warning",
)
- issue.description = (
- "A possible integer overflow exists in the function `{}`.\n"
- "The addition or multiplication may result in a value higher than the maximum representable integer.".format(
- node.function_name
- )
- )
+ issue.description = "The arithmetic operation can result in integer overflow.\n"
issue.debug = solver.pretty_print_model(model)
issues.append(issue)
@@ -213,10 +208,7 @@ def _check_integer_underflow(statespace, state, node):
)
issue.description = (
- "A possible integer underflow exists in the function `"
- + node.function_name
- + "`.\n"
- "The subtraction may result in a value < 0."
+ "The substraction can result in an integer underflow.\n"
)
issue.debug = solver.pretty_print_model(model)
diff --git a/mythril/analysis/modules/multiple_sends.py b/mythril/analysis/modules/multiple_sends.py
index a53e20b5..c3489141 100644
--- a/mythril/analysis/modules/multiple_sends.py
+++ b/mythril/analysis/modules/multiple_sends.py
@@ -33,7 +33,7 @@ def execute(statespace):
)
issue.description = (
- "Multiple sends exist in one transaction. Try to isolate each external call into its own transaction,"
+ "Multiple sends are executed in a single transaction. Try to isolate each external call into its own transaction,"
" as external calls can fail accidentally or deliberately.\nConsecutive calls: \n"
)
diff --git a/mythril/analysis/modules/suicide.py b/mythril/analysis/modules/suicide.py
index 0d1b4859..70e68a4c 100644
--- a/mythril/analysis/modules/suicide.py
+++ b/mythril/analysis/modules/suicide.py
@@ -39,9 +39,8 @@ def _analyze_state(state, node):
to = state.mstate.stack[-1]
logging.debug("[UNCHECKED_SUICIDE] suicide in function " + node.function_name)
- description = (
- "The function `" + node.function_name + "` executes the SUICIDE instruction. "
- )
+
+ description = "A reachable SUICIDE instruction was detected. "
if "caller" in str(to):
description += "The remaining Ether is sent to the caller's address.\n"
diff --git a/mythril/analysis/modules/transaction_order_dependence.py b/mythril/analysis/modules/transaction_order_dependence.py
index bd6a36f8..8d98bfdb 100644
--- a/mythril/analysis/modules/transaction_order_dependence.py
+++ b/mythril/analysis/modules/transaction_order_dependence.py
@@ -43,10 +43,8 @@ def execute(statespace):
)
issue.description = (
- "A possible transaction order dependence vulnerability exists in function {}. The value or "
- "direction of the call statement is determined from a tainted storage location".format(
- node.function_name
- )
+ "Possible transaction order dependence vulnerability: The value or "
+ "direction of the call statement is determined from a tainted storage location"
)
issues.append(issue)
diff --git a/tests/cmd_line_test.py b/tests/cmd_line_test.py
index 9c5033aa..83ade882 100644
--- a/tests/cmd_line_test.py
+++ b/tests/cmd_line_test.py
@@ -26,7 +26,8 @@ class TruffleTestCase(BaseTestCase):
def test_analysis_truffle_project(self):
truffle_project_root = str(TESTS_DIR / "truffle_project")
command = "cd {}; truffle compile; python3 {} --truffle".format(truffle_project_root, MYTH)
- self.assertIn("In the function `withdrawfunds()` a non-zero amount of Ether is sent to msg.sender.", output_of(command))
+ self.assertIn("A non-zero amount of Ether is sent to a user-supplied address. The target address is msg.sender."
+ , output_of(command))
class InfuraTestCase(BaseTestCase):
diff --git a/tests/testdata/outputs_expected/calls.sol.o.graph.html b/tests/testdata/outputs_expected/calls.sol.o.graph.html
index 6af2b5fa..cc2b882d 100644
--- a/tests/testdata/outputs_expected/calls.sol.o.graph.html
+++ b/tests/testdata/outputs_expected/calls.sol.o.graph.html
@@ -8,6 +8,7 @@
Mythril / Ethereum LASER Symbolic VM
-
+
Mythril / Ethereum LASER Symbolic VM
-
+
Mythril / Ethereum LASER Symbolic VM
-
+
Mythril / Ethereum LASER Symbolic VM
-
+
Mythril / Ethereum LASER Symbolic VM
-
+
Mythril / Ethereum LASER Symbolic VM
-
+
Mythril / Ethereum LASER Symbolic VM
-
+
Mythril / Ethereum LASER Symbolic VM
-
+
Mythril / Ethereum LASER Symbolic VM
-
+
+
+
+
+
+
+
+
+
+Mythril / Ethereum LASER Symbolic VM
+
+
+
+