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

FlowSensitivity does not better reflect flowsensitivity #2

Open
crawls-hub opened this issue Mar 29, 2023 · 0 comments
Open

FlowSensitivity does not better reflect flowsensitivity #2

crawls-hub opened this issue Mar 29, 2023 · 0 comments

Comments

@crawls-hub
Copy link

crawls-hub commented Mar 29, 2023

This is the code fragment I decompiled from the apk file:

@Override // android.app.Activity
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_flow_sensitivity);
    TelephonyManager tpm = (TelephonyManager) getSystemService("phone");
    String deviceId = tpm.getDeviceId();
    Log.e("FlowSensitivity1", deviceId);
    Log.e("FlowSensitivity2", "123");
}

From this code,it is clear that there will only raise 1 leak path whether the taint analysis tool is flow-sensitivity or not.
But however when I watched the source code of this apk,I find the original design of it really makes sense.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_flow_sensitivity);

    TelephonyManager tpm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    String deviceId = tpm.getDeviceId();    // Source: <android.telephony.TelephonyManager: java.lang.String getDeviceId()> -> _SOURCE_
    Log.e("FlowSensitivity1", deviceId);    // Sink1, Leak: <android.util.Log: int e(java.lang.String,java.lang.String)> -> _SINK_

    deviceId = "123";
    Log.e("FlowSensitivity2", deviceId);    // Sink2, No leak: <android.util.Log: int e(java.lang.String,java.lang.String)> -> _SINK_
}

This code difference may be caused by compilation optimization which eliminates differences in analysis results.
Considering that much analysis will directly be put on the apk file,maybe a better one which can show the difference is expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant