|
8 | 8 | object. <code>ContentResolver</code>s communicate with an instance of a class that implements the
|
9 | 9 | <code>ContentProvider</code> interface via URIs with the <code>content://</code> scheme.
|
10 | 10 |
|
11 |
| - The authority part (the first path segment) of the URI passed as parameter to the <code>ContentResolver</code> |
| 11 | + The authority part (the first path segment) of the URI, passed as parameter to the <code>ContentResolver</code>, |
12 | 12 | determines which content provider is contacted for the operation. Specific operations that act on files also
|
13 | 13 | support the <code>file://</code> scheme, in which case the local filesystem is queried instead.
|
14 | 14 |
|
15 |
| - If an external component, like a malicious or compromised application, controls the URI that is used in a |
| 15 | + If an external component, like a malicious or compromised application, controls the URI for a |
16 | 16 | <code>ContentResolver</code> operation, it can trick the vulnerable application into accessing its own private
|
17 |
| - files or non-exported content providers. Depending on what the vulnerable application does after accessing the file, |
18 |
| - the attacking application might get access to the file by forcing it to be copied to a public directory like the |
19 |
| - external storage, or tamper with it by making the application overwrite it with unexpected data. |
| 17 | + files or non-exported content providers. The attacking application might be able to get access to the file by forcing it to be copied to a public directory, like |
| 18 | + external storage, or tamper with the contents by making the application overwrite the file with unexpected data. |
20 | 19 | </p>
|
21 | 20 | </overview>
|
22 | 21 | <recommendation>
|
23 | 22 | <p>
|
24 |
| - If possible, avoid using externally-provided data to determine URIs used by a <code>ContentResolver</code>. |
| 23 | + If possible, avoid using externally-provided data to determine the URI for a <code>ContentResolver</code> to use. |
25 | 24 | If that is not an option, validate that the incoming URI can only reference trusted components, like an allow list
|
26 | 25 | of content providers and/or applications, or alternatively make sure that the URI does not reference private
|
27 | 26 | directories like <code>/data/</code>.
|
|
0 commit comments