MCPcopy Create free account
hub / github.com/ParzivalHack/PySpector / TestOSPathJoinPropagation

Class TestOSPathJoinPropagation

tests/unit/test_missing_rules.py:365–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363# ============================================================
364
365class 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# ============================================================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected