Module Import alias Import alias Import alias Assign NameStore TupleLoad Num Num Num Assign NameStore Call AttributeLoad Str attr Call NameLoad NameLoad NameLoad FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return BinOpMod Str TupleLoad Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return BinOpMod Str TupleLoad Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return Call NameLoad AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return BinOpMod Str TupleLoad Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad NameLoad body Return BinOpMod Str Call AttributeLoad Str attr GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return AttributeLoad NameLoad attr orelse Return Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body For NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr NameLoad body If Call NameLoad NameLoad AttributeLoad NameLoad attr body If CompareIn NameLoad GeneratorExp Call NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr body Return NameLoad If Call NameLoad NameLoad Str NameLoad body Return Call NameLoad NameLoad AttributeLoad NameLoad attr orelse Return NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad AttributeLoad NameLoad attr body If Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return Call NameLoad Str NameLoad AttributeLoad NameLoad attr orelse If Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return Call NameLoad Str NameLoad AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body If Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Return Call NameLoad Str NameLoad AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr If CompareIn Call AttributeLoad NameLoad attr TupleLoad Str Str body Assign AttributeStore SubscriptLoad AttributeLoad NameLoad attr Index Num attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse If CompareEq Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Str NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BinOpAdd Str AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body If Call NameLoad NameLoad NameLoad body For NameStore NameLoad body If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad keyword NameLoad With Call NameLoad NameLoad Str NameStore body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Raise Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad If NameLoad body Print Call AttributeLoad Str attr GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Print BinOpMod Str Call NameLoad NameLoad Return Num orelse Return Num decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Call NameLoad
N/A N/A argparse N/A ast N/A sys N/A version_info N/A 0 1 1 N/A __version__ N/A N/A . join N/A map str version_info stringify N/A N/A node N/A N/A N/A N/A isinstance node N/A ast Name N/A N/A N/A node id N/A N/A N/A isinstance node N/A ast Attribute N/A N/A N/A %s.%s N/A N/A stringify N/A node value N/A node attr N/A N/A N/A isinstance node N/A ast Subscript N/A N/A N/A %s[%s] N/A N/A stringify N/A node value N/A stringify N/A node slice N/A N/A N/A isinstance node N/A ast Index N/A N/A N/A stringify N/A node value N/A N/A N/A isinstance node N/A ast Call N/A N/A N/A %s(%s, %s) N/A N/A stringify N/A node func N/A stringify N/A node args N/A stringify N/A node keywords N/A N/A N/A isinstance node list N/A N/A N/A [%s] N/A N/A ,  join N/A N/A stringify n N/A n node N/A N/A N/A isinstance node N/A ast Str N/A N/A N/A node s N/A N/A N/A N/A ast dump node N/A IllegalLine N/A object N/A __init__ N/A N/A self reason node filename N/A N/A N/A N/A self reason reason N/A N/A self lineno N/A node lineno N/A N/A self filename filename N/A N/A self node node N/A __str__ N/A N/A self N/A N/A N/A N/A %s:%d	%s N/A N/A self filename N/A self lineno N/A self reason N/A __repr__ N/A N/A self N/A N/A N/A N/A IllegalLine<%s, %s:%s> N/A N/A self reason N/A self filename N/A self lineno N/A N/A find_assignment_in_context N/A N/A variable context N/A N/A N/A N/A isinstance context N/A N/A ast FunctionDef N/A ast Module N/A ast For N/A ast While N/A ast With N/A ast If N/A N/A node N/A reversed N/A list N/A N/A ast iter_child_nodes context N/A N/A N/A isinstance node N/A ast Assign N/A N/A N/A variable N/A N/A stringify c N/A c N/A node targets N/A N/A node N/A N/A getattr context parent None N/A N/A N/A find_assignment_in_context variable N/A context parent N/A N/A None N/A Checker N/A N/A ast NodeVisitor N/A __init__ N/A N/A self filename N/A args kwargs N/A N/A N/A self filename filename N/A N/A self errors N/A N/A N/A N/A N/A super Checker self __init__ args kwargs N/A check_execute N/A N/A self node N/A N/A N/A N/A isinstance node N/A ast BinOp N/A N/A N/A isinstance N/A node op N/A ast Mod N/A N/A N/A IllegalLine string interpolation of SQL query node N/A self filename N/A N/A N/A isinstance N/A node op N/A ast Add N/A N/A N/A IllegalLine string concatenation of SQL query node N/A self filename N/A N/A N/A isinstance node N/A ast Call N/A N/A N/A isinstance N/A node func N/A ast Attribute N/A N/A N/A N/A N/A node func attr format N/A N/A N/A IllegalLine str.format called on SQL query node N/A self filename N/A N/A N/A isinstance node N/A ast Name N/A N/A assignment N/A find_assignment_in_context N/A node id node N/A N/A assignment None N/A N/A N/A N/A self check_execute N/A assignment value N/A visit_Call N/A N/A self node N/A N/A N/A function_name N/A stringify N/A node func N/A N/A N/A N/A function_name lower N/A session.execute cursor.execute N/A N/A N/A N/A N/A node args N/A 0 parent node N/A node_error N/A N/A self check_execute N/A N/A node args N/A 0 N/A node_error N/A N/A N/A N/A N/A self errors append node_error N/A N/A N/A N/A N/A function_name lower eval N/A N/A N/A N/A N/A self errors append N/A IllegalLine eval() is just generally evil node N/A self filename N/A N/A N/A self generic_visit node N/A visit N/A N/A self node N/A N/A N/A Visit a node. N/A method N/A visit_ N/A N/A node __class__ __name__ N/A visitor N/A getattr self method N/A self generic_visit N/A N/A visitor node N/A generic_visit N/A N/A self node N/A N/A N/A Called if no explicit visitor function exists for a node. N/A N/A field value N/A N/A ast iter_fields node N/A N/A N/A isinstance value list N/A N/A item value N/A N/A N/A isinstance item N/A ast AST N/A N/A N/A item parent node N/A N/A N/A self visit item N/A N/A N/A isinstance value N/A ast AST N/A N/A N/A value parent node N/A N/A N/A self visit value N/A N/A check N/A N/A filename N/A N/A N/A c N/A Checker filename filename N/A N/A open filename r fobj N/A N/A N/A N/A parsed N/A N/A ast parse N/A N/A fobj read filename N/A N/A N/A c visit parsed N/A N/A N/A Exception N/A N/A N/A N/A c errors N/A main N/A N/A N/A N/A N/A parser N/A N/A argparse ArgumentParser description Look for patterns in python source files that might indicate SQL injection vulnerabilities epilog Exit status is 0 if all files are okay, 1 if any files have an error. Errors are printed to stdout N/A N/A N/A parser add_argument --version action version version N/A %(prog)s  __version__ N/A N/A N/A parser add_argument files nargs + help Files to check N/A args N/A N/A parser parse_args N/A errors N/A N/A fname N/A args files N/A N/A these_errors N/A check fname N/A these_errors N/A N/A N/A N/A join N/A N/A str e N/A e these_errors N/A N/A N/A errors extend these_errors N/A errors N/A N/A N/A %d total errors N/A len errors N/A 1 N/A N/A 0 N/A N/A N/A __name__ __main__ N/A N/A N/A N/A sys exit N/A main