From 9f4be7d7fbfcc429e9e4ed6d9b069216958f4675 Mon Sep 17 00:00:00 2001 From: webthethird Date: Thu, 16 Mar 2023 14:24:57 -0500 Subject: [PATCH] Include variables touched by tainted functions --- slither/utils/upgradeability.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/slither/utils/upgradeability.py b/slither/utils/upgradeability.py index d52bb6514..f69b336f5 100644 --- a/slither/utils/upgradeability.py +++ b/slither/utils/upgradeability.py @@ -105,7 +105,10 @@ def compare(v1: Contract, v2: Contract) -> dict: written_by = v2.get_functions_writing_to_variable(var) if v1.get_state_variable_from_name(var.name) is None: results["new-variables"].append(var) - elif any(func in read_by or func in written_by for func in new_modified_functions): + elif any( + func in read_by or func in written_by + for func in new_modified_functions + results["tainted-functions"] + ): results["tainted-variables"].append(var) return results