mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Python: support user defined taint source
This commit is contained in:
@@ -45,7 +45,7 @@ async def test_async_for():
|
||||
iter = AsyncIter()
|
||||
taint(iter)
|
||||
async for tainted in iter:
|
||||
ensure_tainted(tainted) # $ MISSING: tainted
|
||||
ensure_tainted(tainted) # $ tainted
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,12 @@ class TestTaintTrackingConfiguration extends TaintTracking::Configuration {
|
||||
"TAINTED_STRING", "TAINTED_BYTES", "TAINTED_LIST", "TAINTED_DICT"
|
||||
]
|
||||
or
|
||||
// User defined sources
|
||||
exists(CallNode call |
|
||||
call.getFunction().(NameNode).getId() = "taint" and
|
||||
source.(DataFlow::CfgNode).getNode() = call.getAnArg()
|
||||
)
|
||||
or
|
||||
source instanceof RemoteFlowSource
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user