| 363 | # ============================================================ |
| 364 | |
| 365 | class TestOSPathJoinPropagation: |
| 366 | def test_path_join_propagates_to_open(self): |
| 367 | code = """ |
| 368 | blog = request.POST.get('blog') |
| 369 | filename = os.path.join('/app/blogs', blog) |
| 370 | f = open(filename, 'r') |
| 371 | """ |
| 372 | assert fires(code, "OPEN1149"), "os.path.join must propagate taint to open() → OPEN1149" |
| 373 | |
| 374 | def test_imagmath_eval_via_sink(self): |
| 375 | code = """ |
| 376 | from PIL import ImageMath, Image |
| 377 | func = request.POST.get('function') |
| 378 | img = Image.open('test.png') |
| 379 | output = ImageMath.eval(func, img=img) |
| 380 | """ |
| 381 | assert fires(code, "PY001"), "ImageMath.eval() must fire PY001 via SK_IMG_EVAL001 taint sink" |
| 382 | |
| 383 | |
| 384 | # ============================================================ |
nothing calls this directly
no outgoing calls
no test coverage detected