@@ -110,20 +110,25 @@ def test_build_sanitiser_node_dict(self):
110110
111111 self .assertEqual (sanitiser_dict ['escape' ][0 ], cfg .nodes [3 ])
112112
113- def run_analysis (self , path = None ):
113+ def run_analysis (
114+ self ,
115+ path = None ,
116+ adaptor_function = is_flask_route_function ,
117+ trigger_file = default_trigger_word_file ,
118+ ):
114119 if path :
115120 self .cfg_create_from_file (path )
116121 cfg_list = [self .cfg ]
117122
118- FrameworkAdaptor (cfg_list , [], [], is_flask_route_function )
123+ FrameworkAdaptor (cfg_list , [], [], adaptor_function )
119124 initialize_constraint_table (cfg_list )
120125
121126 analyse (cfg_list )
122127
123128 return find_vulnerabilities (
124129 cfg_list ,
125130 default_blackbox_mapping_file ,
126- default_trigger_word_file
131+ trigger_file ,
127132 )
128133
129134 def test_find_vulnerabilities_assign_other_var (self ):
@@ -470,6 +475,13 @@ def test_recursion(self):
470475 vulnerabilities = self .run_analysis ('examples/vulnerable_code/recursive.py' )
471476 self .assert_length (vulnerabilities , expected_length = 2 )
472477
478+ def test_list_append_taints_list (self ):
479+ vulnerabilities = self .run_analysis (
480+ 'examples/vulnerable_code/list_append.py' ,
481+ adaptor_function = is_function ,
482+ )
483+ self .assert_length (vulnerabilities , expected_length = 1 )
484+
473485
474486class EngineDjangoTest (VulnerabilitiesBaseTestCase ):
475487 def run_analysis (self , path ):
0 commit comments