|
5 | 5 | <qhelp>
|
6 | 6 |
|
7 | 7 | <overview>
|
8 |
| -<p>A <code>PendingIntent</code> describes an action in the form of an Intent that is intended to be given and executed |
9 |
| - at a later time by another application. The Intent wrapped by a <code>PendingIntent</code> is executed on behalf of |
10 |
| - the application that created it, and with its same privileges.</p> |
11 |
| -<p>If a <code>PendingIntent</code> is configured to be mutable, the fields of its internal Intent can be changed by the |
12 |
| - receiving application if they were not previously set. This means that a mutable <code>PendingIntent</code> that has |
13 |
| - not defined a destination component (that is, an implicit <code>PendingIntent</code>) can be altered to execute an |
| 8 | +<p>A <code>PendingIntent</code> is used to wrap an <code>Intent</code> that will be supplied and executed by another |
| 9 | + application. When the <code>Intent</code> is executed, it behaves as if it were run directly by the supplying |
| 10 | + application, using the privileges of that application.</p> |
| 11 | +<p>If a <code>PendingIntent</code> is configured to be mutable, the fields of its internal <code>Intent</code> can be changed by the |
| 12 | + receiving application if they were not previously set. This means that a mutable <code>PendingIntent</code> that has |
| 13 | + not defined a destination component (that is, an implicit <code>PendingIntent</code>) can be altered to execute an |
14 | 14 | arbitrary action with the privileges of the application that created it.</p>
|
15 |
| -<p>If an implicit <code>PendingIntent</code> is obtainable by a malicious application by any of the following means:</p> |
| 15 | +<p>A malicious application can access an implicit <code>PendingIntent</code> as follows:</p> |
16 | 16 | <ul>
|
17 |
| - <li>It is wrapped and sent as an extra of another implicit Intent</li> |
18 |
| - <li>It is sent as the action of a Slide</li> |
19 |
| - <li>It is sent as the action of a Notification</li> |
| 17 | + <li>It is wrapped and sent as an extra of another implicit <code>Intent</code>.</li> |
| 18 | + <li>It is sent as the action of a <code>Slide</code>.</li> |
| 19 | + <li>It is sent as the action of a <code>Notification</code>.</li> |
20 | 20 | </ul>
|
21 | 21 | <p></p>
|
22 |
| -<p>the attacker could modify the underlying Intent and execute an arbitrary action with elevated privileges. |
23 |
| - This could give the malicious application access to private components of the victim application, |
24 |
| - or the ability to perform actions without having the necessary permissions.</p> |
| 22 | +<p>On gaining access, the attacker can modify the underlying <code>Intent</code> and execute an arbitrary action |
| 23 | + with elevated privileges. This could give the malicious application access to private components of the victim |
| 24 | + application, or the ability to perform actions without having the necessary permissions.</p> |
25 | 25 | </overview>
|
26 | 26 |
|
27 | 27 | <recommendation>
|
28 |
| -<p>Avoid creating implicit <code>PendingIntent</code>s. This means that the underlying Intent should always have an |
| 28 | +<p>Avoid creating implicit <code>PendingIntent</code>s. This means that the underlying <code>Intent</code> should always have an |
29 | 29 | explicit destination component.</p>
|
30 |
| -<p>Also, when adding the <code>PendingIntent</code> as an extra of another Intent, make sure that said Intent also has |
| 30 | +<p>When you add the <code>PendingIntent</code> as an extra of another <code>Intent</code>, make sure that this second <code>Intent</code> also has |
31 | 31 | an explicit destination component, so that it is not delivered to untrusted applications.</p>
|
32 |
| -<p>It is also recommended to create the <code>PendingIntent</code> using the flag <code>FLAG_IMMUTABLE</code> whenever |
33 |
| - possible, to prevent the destination component from modifying empty fields of the underlying Intent.</p> |
| 32 | +<p>Create the <code>PendingIntent</code> using the flag <code>FLAG_IMMUTABLE</code> whenever possible, |
| 33 | + to prevent the destination component from modifying empty fields of the underlying <code>Intent</code>.</p> |
34 | 34 | </recommendation>
|
35 | 35 |
|
36 | 36 | <example>
|
37 |
| - <p>In the following examples, a <code>PendingIntent</code> is created and wrapped as an extra of another Intent. |
| 37 | + <p>In the following examples, a <code>PendingIntent</code> is created and wrapped as an extra of another <code>Intent</code>. |
38 | 38 | </p>
|
39 |
| - <p>In the first example, both the <code>PendingIntent</code> and the Intent it is wrapped in are implicit, |
40 |
| - reproducing the vulnerability.</p> |
| 39 | + <p>In the first example, both the <code>PendingIntent</code> and the <code>Intent</code> it is wrapped in are implicit, |
| 40 | + making them vulnerable to attack.</p> |
41 | 41 | <p>In the second example, the issue is avoided by adding explicit destination components to the
|
42 |
| - <code>PendingIntent</code> and the wrapping Intent.</p> |
43 |
| - <p>The third example uses the <code>FLAG_IMMUTABLE</code> flag to prevent the underlying Intent from being modified |
| 42 | + <code>PendingIntent</code> and the wrapping <code>Intent</code>.</p> |
| 43 | + <p>The third example uses the <code>FLAG_IMMUTABLE</code> flag to prevent the underlying <code>Intent</code> from being modified |
44 | 44 | by the destination component.</p>
|
45 | 45 | <sample src="ImplicitPendingIntents.java" />
|
46 | 46 | </example>
|
|
0 commit comments