Skip to content

Commit

Permalink
RoleBasedAccessControl: Added missing check before calling _sha3_prep…
Browse files Browse the repository at this point in the history
…rocess to verify that the top two stack elements are concrete
  • Loading branch information
metagon committed Feb 20, 2021
1 parent d761bfd commit 0cbaa8e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ithildin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from mythril.mythril.mythril_config import MythrilConfig

__version__ = '0.2.4'
__version__ = '0.2.5'

formatter = logging.Formatter('[%(levelname)s\t] %(asctime)s - %(name)s %(message)s')

Expand Down
4 changes: 3 additions & 1 deletion ithildin/analysis/strategies/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def _analyze(self, state: GlobalState, prev_state: Optional[GlobalState] = None)
elif state.instruction['opcode'] == 'MSTORE' and state.mstate.stack[-2].symbolic is False:
# Memorize values before being stored to propagate annotations later
self._mstore_preprocess(state)
elif state.instruction['opcode'] == 'SHA3':
elif state.instruction['opcode'] == 'SHA3' and \
state.mstate.stack[-1].symbolic is False and \
state.mstate.stack[-2].symbolic is False:
# Check if there are annotations for concrete values to be forwarded
self._sha3_preprocess(state)
elif state.instruction['opcode'] == 'JUMPI' and {HashedCaller(), HashedRole()}.issubset(state.mstate.stack[-2].annotations):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pathlib
from setuptools import find_packages, setup

VERSION = '0.2.4'
VERSION = '0.2.5'
CURRENT_DIR = pathlib.Path(__file__).parent
README = (CURRENT_DIR / 'README.md').read_text()
PYTHON_REQUIREMENT = '>=3.6.0'
Expand Down

0 comments on commit 0cbaa8e

Please sign in to comment.