(fixtures, fuzzy_rule_match)
| 79 | |
| 80 | |
| 81 | def test_taint_log_flask_app(fixtures, fuzzy_rule_match): |
| 82 | match_log = [ |
| 83 | { |
| 84 | "line_no": 44, |
| 85 | "message": "AST node marked as source using semantic rules", |
| 86 | "taint_level": "TAINTED" |
| 87 | }, |
| 88 | { |
| 89 | "line_no": 44, |
| 90 | "message": "Taint propagated via variable subscript", |
| 91 | "taint_level": "TAINTED" |
| 92 | }, |
| 93 | { |
| 94 | "line_no": 45, |
| 95 | "message": "Taint propagated by return/yield statement", |
| 96 | "taint_level": "TAINTED" |
| 97 | } |
| 98 | ] |
| 99 | |
| 100 | output = fixtures.scan_test_file('flask_app.py') |
| 101 | |
| 102 | for h in output['detections']: |
| 103 | if h['line_no'] == 45: |
| 104 | log = h['extra']['taint_log'] |
| 105 | break |
| 106 | else: |
| 107 | raise AssertionError("Taint log hit not found") |
| 108 | |
| 109 | assert fuzzy_rule_match(log, match_log) |
| 110 | |
| 111 | |
| 112 | def test_variable_assignment_propagation(): |
nothing calls this directly
no test coverage detected