Skip to content

Taint Tracking in Java - Restrict tracking to the code reachable from the source #17241

Answered by ginsbach
dvec01 asked this question in Q&A
Discussion options

You must be logged in to vote

Excuse the poor choice of method names. Also, I noticed that the code snippet I posted was wrong. To clarify, I am not looking for a way to exclude sinks that are (solely) in dead methods, but in methods that cannot be reached from the source method. To extend the previous code snippet:

You could use the Java call graph classes to enforce that restriction.

However, note that there might be good reasons for the existing behaviour. Consider the following example:

import java.lang.Runtime;
import java.lang.Exception;

public class Main {

    private static String s1 = "";

    public static void runBoth(String userInput) {
        source(userInput);
        method2();
    }

    public st…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ginsbach
Comment options

Answer selected by dvec01
@dvec01
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants