Skip to content

Commit 07d5086

Browse files
committed
Python: support user defined taint source
1 parent 5d7b09a commit 07d5086

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep/test_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def test_async_for():
4545
iter = AsyncIter()
4646
taint(iter)
4747
async for tainted in iter:
48-
ensure_tainted(tainted) # $ MISSING: tainted
48+
ensure_tainted(tainted) # $ tainted
4949

5050

5151

python/ql/test/experimental/meta/InlineTaintTest.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ class TestTaintTrackingConfiguration extends TaintTracking::Configuration {
3838
"TAINTED_STRING", "TAINTED_BYTES", "TAINTED_LIST", "TAINTED_DICT"
3939
]
4040
or
41+
// User defined sources
42+
exists(CallNode call |
43+
call.getFunction().(NameNode).getId() = "taint" and
44+
source.(DataFlow::CfgNode).getNode() = call.getAnArg()
45+
)
46+
or
4147
source instanceof RemoteFlowSource
4248
}
4349

0 commit comments

Comments
 (0)