mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Add additional test cases
This commit is contained in:
@@ -10,6 +10,10 @@ private module NotificationTrackingConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node src) { src.asExpr() instanceof SensitiveExpr }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) { sinkNode(sink, "notification") }
|
||||
|
||||
predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet c) {
|
||||
isSink(node) and exists(c)
|
||||
}
|
||||
}
|
||||
|
||||
/** Taint tracking flow for sensitive data flowing to system notifications. */
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import android.app.Activity;
|
||||
import android.app.Notification;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import android.content.Intent;
|
||||
import android.app.PendingIntent;
|
||||
|
||||
class Test extends Activity {
|
||||
void test(String password) {
|
||||
@@ -12,5 +14,17 @@ class Test extends Activity {
|
||||
void test2(String password) {
|
||||
Notification.Builder builder = new Notification.Builder(this, "");
|
||||
builder.setContentText(password); // $sensitive-notification
|
||||
builder.setContentTitle(password); // $sensitive-notification
|
||||
builder.addAction(0, password, null); // $sensitive-notification
|
||||
builder.addAction(new Notification.Action(0, password, null)); // $sensitive-notification
|
||||
// builder.setStyle( // TODO: update stubs to include MessagingStyle
|
||||
// new Notification.MessagingStyle(password) // $sensitive-notification
|
||||
// .setConversationTitle(password)) // $sensitive-notification
|
||||
// .addMessage(password, 0, null); // $sensitive-notification
|
||||
builder.setStyle(new Notification.BigTextStyle().bigText(password)); // $sensitive-notification
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("a", password);
|
||||
builder.setContentIntent(PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE)); // $MISSING: sensitive-notification // missing model for getActivity
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user