OSDN Git Service

RESTRICT AUTOMERGE
authorJeff Sharkey <jsharkey@android.com>
Thu, 18 Jul 2019 00:51:28 +0000 (18:51 -0600)
committerSterling Huber <hubers@google.com>
Fri, 6 Sep 2019 22:31:01 +0000 (15:31 -0700)
commit382d5c0c199f3743514e024d2fd921248f7b14b3
tree5fde58f50ba982e429ce2fda34e4108652300557
parent46368e4f5cf4ff4582942bcc8ab23636c702daa3
RESTRICT AUTOMERGE
Enable stricter SQLiteQueryBuilder options.

Malicious callers can leak side-channel information by using
subqueries in any untrusted inputs where SQLite allows "expr" values.

This change starts using setStrictColumns() and setStrictGrammar()
on SQLiteQueryBuilder to block this class of attacks.  This means we
now need to define the projection mapping of valid columns, which
consists of both the columns defined in the public API and columns
read internally by DownloadInfo.Reader.

We're okay growing sAppReadableColumnsSet like this, since we're
relying on our trusted WHERE clause to filter away any rows that
don't belong to the calling UID.

Remove the legacy Lexer code, since we're now internally relying on
the robust and well-tested SQLiteTokenizer logic.

Bug: 135270103
Bug: 135269143
Test: atest DownloadProviderTests
Test: atest CtsAppTestCases:android.app.cts.DownloadManagerTest
Change-Id: Iec1e8ce18dc4a9564318e0473d9d3863c8c2988a
core/java/android/app/DownloadManager.java