Skip to content

Commit

Permalink
Merge pull request #308 from Nizernizer/main
Browse files Browse the repository at this point in the history
fix bug: COOKIE_FLAGS_MISSING
  • Loading branch information
Nizernizer authored May 16, 2022
2 parents 4a6c9bc + 521686f commit ddd7b16
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.dongtai.iast.core.bytecode.enhance.IastContext;
import io.dongtai.iast.core.bytecode.enhance.plugin.AbstractClassVisitor;
import io.dongtai.iast.core.bytecode.enhance.plugin.core.adapter.PropagateAdviceAdapter;
import io.dongtai.iast.core.bytecode.enhance.plugin.core.adapter.SinkAdviceAdapter;
import io.dongtai.iast.core.utils.AsmUtils;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
Expand Down Expand Up @@ -31,7 +32,11 @@ public MethodVisitor visitMethod(final int access, final String name, final Stri
if (match(name, context.getMatchClassName())) {
String iastMethodSignature = AsmUtils.buildSignature(context.getMatchClassName(), name, desc);
String framework = "refType";
mv = new PropagateAdviceAdapter(mv, access, name, desc, context, framework, iastMethodSignature);
if (iastMethodSignature.contains("setSecure") || iastMethodSignature.contains("<init>")){
mv = new SinkAdviceAdapter(mv, access, name, desc, context, framework, iastMethodSignature,false);
}else {
mv = new PropagateAdviceAdapter(mv, access, name, desc, context, framework, iastMethodSignature);
}
setTransformed();
DongTaiLog.trace("rewrite method {} for listener[match={},class={}]", iastMethodSignature, context.getMatchClassName(), context.getClassName());
}
Expand Down

0 comments on commit ddd7b16

Please sign in to comment.