Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False negative with taint propagated via class attribute #174

Open
draftyfrog opened this issue Nov 14, 2024 · 1 comment
Open

False negative with taint propagated via class attribute #174

draftyfrog opened this issue Nov 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@draftyfrog
Copy link

Bug

Bug description
This might be the False Negative counterpart to the False Positive reported in #173.

Please consider the following code

public class MainActivity extends AppCompatActivity{
  public void onCreate(Bundle savedInstanceState){
    MyClass myInstance = new MyClass();
    String myString = myInstance.myField;
    myInstance.myField = "";
    sink(myString); // NOT reported as issue by Mariana Trench
  }

  public static String source(){ // Defined as source in MT config
    return "Secret";
  }

  public void sink(String param){} // Defined as sink in MT config
}

class MyClass{
  String myField = MainActivity.source();
}

As annotated in the code, Mariana Trench doesn't detect any issues, but actually the sink in MainActivity.onCreate should be reported.

I'm using mariana-trench Version: 1.0.6.

@arthaud
Copy link
Contributor

arthaud commented Nov 17, 2024

Hi @draftyfrog, thanks for reaching out.

The problem here is that we don't handle static initializers (i.e String myField = MainActivity.source()) correctly. I believe we have plans to tackle this bug soon (maybe within the next 6 months).

This is not related to #173.

@arthaud arthaud added the bug Something isn't working label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants