File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
java/ql/lib/semmle/code/java/security Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ private class SendPendingIntent extends ImplicitPendingIntentSink {
6868 override predicate hasState ( DataFlow:: FlowState state ) { state = "MutablePendingIntent" }
6969}
7070
71+ /**
72+ * Propagates taint from any tainted object to reads from its `PendingIntent`-typed fields.
73+ */
7174private class PendingIntentAsFieldAdditionalTaintStep extends ImplicitPendingIntentAdditionalTaintStep {
7275 override predicate step ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
7376 exists ( Field f |
@@ -91,10 +94,11 @@ private class MutablePendingIntentFlowStep extends PendingIntentAsFieldAdditiona
9194 node2 .asExpr ( ) = pic and
9295 flagArg = pic .getFlagsArg ( )
9396 |
94- // API < 31, PendingIntents are mutable by default
97+ // We err on the side of false positives here, assuming a PendingIntent may be mutable unless it is at
98+ // least sometimes explicitly marked immutable and never marked mutable.
99+ // Note for API level < 31, PendingIntents were mutable by default, whereas since then they are immutable by default.
95100 not TaintTracking:: localExprTaint ( any ( ImmutablePendingIntentFlag flag ) .getAnAccess ( ) , flagArg )
96101 or
97- // API >= 31, PendingIntents need to explicitly set mutability
98102 TaintTracking:: localExprTaint ( any ( MutablePendingIntentFlag flag ) .getAnAccess ( ) , flagArg )
99103 )
100104 }
You can’t perform that action at this time.
0 commit comments