Skip to content

Commit c909b88

Browse files
Apply suggestions from code review
Co-authored-by: Felicity Chapman <[email protected]>
1 parent ceae5ee commit c909b88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public void onCreate() {
1010
InputStream is = contentResolver.openInputStream(uri);
1111
copyToExternalCache(is);
1212
}
13-
// BAD: input Uri is not normalized, and check can be bypassed with ".." characters
13+
// BAD: input URI is not normalized, and check can be bypassed with ".." characters
1414
{
1515
ContentResolver contentResolver = getContentResolver();
1616
Uri uri = (Uri) getIntent().getParcelableExtra("URI_EXTRA");
@@ -20,7 +20,7 @@ public void onCreate() {
2020
InputStream is = contentResolver.openInputStream(uri);
2121
copyToExternalCache(is);
2222
}
23-
// GOOD: URI gets properly validated to avoid access to internal files
23+
// GOOD: URI is properly validated to block access to internal files
2424
{
2525
ContentResolver contentResolver = getContentResolver();
2626
Uri uri = (Uri) getIntent().getParcelableExtra("URI_EXTRA");

java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<example>
3131
<p>
3232
This example shows two ways of opening a file using a <code>ContentResolver</code>. In the first case, externally-provided
33-
data coming from an intent is directly used in the file-reading operation, allowing an attacker to provide a URI
33+
data from an intent is used directly in the file-reading operation. This allows an attacker to provide a URI
3434
of the form <code>/data/data/(vulnerable app package)/(private file)</code> to trick the application into reading it and
3535
copying it to the external storage. In the second case, the URI is validated before being used, making sure it does not reference
3636
any internal application files.

0 commit comments

Comments
 (0)