Skip to content

Commit 164a093

Browse files
authored
Merge pull request #501 from lostsnow/fix/ignore-propagator-collect-when-taint-not-change
ignore the collection of propagators when the taint has not change
2 parents 379e927 + ea307e4 commit 164a093

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/controller/impl/PropagatorImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ private static void addPropagator(PropagatorNode propagatorNode, MethodEvent eve
4545
Set<TaintPosition> sources = propagatorNode.getSources();
4646
Set<TaintPosition> targets = propagatorNode.getTargets();
4747

48+
TaintCommandRunner r = TaintCommandRunner.getCommandRunner(event.signature);
4849
// O => O || O => R, source equals target and no change in taint range
4950
if (event.getSourceHashes().equals(event.getTargetHashes())
5051
&& sources.size() == 1 && targets.size() == 1
5152
&& TaintPosition.hasObject(sources)
52-
&& TaintCommandRunner.getCommandRunner(event.signature) == null
53+
&& (r == null || TaintCommand.KEEP.equals(r.getCommand()) || TaintCommand.TRIM.equals(r.getCommand())
54+
|| TaintCommand.TRIM_LEFT.equals(r.getCommand()) || TaintCommand.TRIM_RIGHT.equals(r.getCommand()))
5355
) {
5456
if (TaintPosition.hasObject(targets) || TaintPosition.hasReturn(targets)) {
5557
return;

dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/models/taint/range/TaintCommandRunner.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public int getParam(Object[] params) {
4242
}
4343
}
4444

45+
public TaintCommand getCommand() {
46+
return command;
47+
}
48+
4549
public static TaintCommandRunner create(String signature, TaintCommand command) {
4650
return create(signature, command, null);
4751
}

0 commit comments

Comments
 (0)