Commit Graph
231 Commits
Author SHA1 Message Date
Tom Taylor 3671fd94ae 37742976 - Catch bad gifs
* A security researcher crafted a gif that would cause the Android
Bitmap code to throw an NPE. That would cause messaging to crash when
decoding the NPE. Catch the NPE.

Test: manually tested the "crash.gif" attached to the bug. Stepped
through the debugger to verify we're catching the NPE and logging
the attempt. Verified normal gifs still work.

BUG=37742976

Change-Id: Iab814d5b0b514bed0cecddd9a76f1fc095f90892
2017-06-23 14:09:12 -07:00
Aurimas Liutikas d3b23f568a Remove usages of ActionBarActivity.
ActionBarActivity has been deprecated for 2+ years and has been
extending AppCompatActivity for all that time. These changes
should be no-ops.

Bug: 35253513
Test: None
Change-Id: I699f327aaa99b26a0a0b562cf425203e4b625c33
(cherry picked from commit 11224977e7)
2017-06-06 15:13:49 +00:00
Aurimas Liutikas 11224977e7 Remove usages of ActionBarActivity.
ActionBarActivity has been deprecated for 2+ years and has been
extending AppCompatActivity for all that time. These changes
should be no-ops.

Bug: 35253513
Test: None
Change-Id: I699f327aaa99b26a0a0b562cf425203e4b625c33
2017-05-18 11:16:47 -07:00
Tom Taylor db45a19fe5 37544704 PduPersister is not doing a safe Uri comparison
* The PduPersister had some code where it checked uris for
equality, but didn't use the safe .equals method.

Test: manual test of sending and receiving mms's.

Bug: 37544704

Change-Id: I6dfd037068b4eff04c34cd9d41760e36e11915d6
2017-05-01 09:21:52 -07:00
Tom Taylor e0f37bb8e1 22851197 Messaging Application crash with unsupported type's URI
This bug and AOSP patch arrived last July. Supposedly, I
merged the change, but it's certainly not fixed in bugler, nor in various
copies of PduPersister in Android's master. Fixing all the locations
now.

Test: manual - sent/received MMS's to verify the change didn't break
existing behavior.

Bug: 22851197
Change-Id: Ia79bd9951b1820ebc42baf0eef38667753d77ab9
2017-02-23 10:41:40 -08:00
Paul Duffin 3cce9e3644 Use com.android.messaging.util.Assert instead of junit.framework.Assert
am: 991c2e5ab8

Change-Id: Ifb50be13961d566c58c25c3f9f6e7a4ac4b6a260
2017-02-21 18:01:15 +00:00
Paul Duffin 991c2e5ab8 Use com.android.messaging.util.Assert instead of junit.framework.Assert
Bug: 35234379
Bug: 30188076
Test: make checkbuild
Change-Id: I3aa9b72393d128877c86c9a116495f76f3e50e18
2017-02-21 11:23:14 +00:00
Tom Taylor 4d220d4777 resolve merge conflicts of eafd58a to nyc-dev
am: a43c5c5f18

Change-Id: Ibcf2308553a68a8deaa05d15548d3eca67d4579a
2016-12-07 02:45:53 +00:00
Tom Taylor a43c5c5f18 resolve merge conflicts of eafd58a to nyc-dev
Change-Id: I58151ca0c248dd4b84c78c8e7ca73d5a80bbd962
2016-12-06 16:26:14 -08:00
Tom Taylor 4dfcff98da 32807795 Security Vulnerability - AOSP Messaging App: thirdparty can attach private files from "/data/data/com.android.messaging/" directory to the messaging app. am: a2aa53f83a am: 90bf70396d am: 305a004e19 am: 2397f2fbef
am: 313284eee7

Change-Id: Iaa18124b7f9090efe55a0a46a1851ff5c0b6fe28
2016-12-06 22:27:37 +00:00
Tom Taylor 313284eee7 32807795 Security Vulnerability - AOSP Messaging App: thirdparty can attach private files from "/data/data/com.android.messaging/" directory to the messaging app. am: a2aa53f83a am: 90bf70396d am: 305a004e19
am: 2397f2fbef

Change-Id: I16b590f76c9856d1407b336973ba86ff681415c6
2016-12-06 22:24:07 +00:00
Tom Taylor 10dccb12ad 32161610 Security Vulnerability - Information disclosure vulnerability in AOSP Messaging
am: 69ed579fb8

Change-Id: I4be088ae899c6729da2197a9ab23951dc95c238e
2016-12-06 22:13:14 +00:00
Tom Taylor 3f6e2e2b07 Merge "32161610 Security Vulnerability - Information disclosure vulnerability in AOSP Messaging" into mnc-dev 2016-12-06 22:11:03 +00:00
Tom Taylor a2aa53f83a 32807795 Security Vulnerability - AOSP Messaging App: thirdparty can
attach private files from "/data/data/com.android.messaging/"
directory to the messaging app.

* This is a manual merge from ag/871758 -- backporting a security fix from
Bugle to Kazoo.
* Don't export the MediaScratchFileProvider or the MmsFileProvider. This
will block external access from third party apps. In addition, make both
providers more robust in handling path names. Make sure the file paths
handled in the providers point to the expected directory.

Change-Id: I9e6b3ae0e122e3f5022243418f2893d4a0859edb
Fixes: 32807795
2016-12-05 16:39:55 -08:00
Tom Taylor 69ed579fb8 32161610 Security Vulnerability - Information disclosure vulnerability
in AOSP Messaging

* Check to make sure the returned uri from the gallery picker does
not point to bugle's data directory (or any subdir).

* Test:
Manual-
* I created the test app in the bug, the one that injects the bad
uri into Bugle. I verified the bad behavior before the fix and the
good behavior after.
* I tested the gallery to make sure picking photos,
from the photos app and drive, still work.
* I verified the behavior in the debugger to be sure the code is
catching the bad uri from the test app.

Change-Id: I3393f3b886c837a49758b91945cf1e17ec9bee41
Fixes: 32161610
2016-12-05 13:57:45 -08:00
Tony Mak 7ad7ac27f1 Show badge icon if any participant in the conversation is work contact
Precompute is_enterprise and stored the value in conversation table.
Include is_enterprise in the ConversationList view.

Change-Id: I2e31bd61c08d25a296aaa3e99cb24631ae2e7976
2016-06-29 10:58:33 +01:00
Tony Mak 2a50ffe57c Add badge in conversation view if the participant is a work contact
TODO: To handle conversation having more than one participants.

Bug: 29065176
Change-Id: I3820454bf2b76c151dc3a13d9be270502029160d
2016-06-28 15:44:27 +01:00
Tavis Bohne 41f3b673f1 Messenger refuses all file:///data/ uris
We've been informed it's possible for an app to create a world
readable hardlink in L in its own /data directory that links to
another apps private data, including Messenger data. The hardlink
bypassed our existing checks. So now we simply refuse all file: uris
in the /data/ directory.
Other apps shouldn't be sending file uris anyway, and we dont know
of any that send file:///data/ uris.

Bug: 28793303
Change-Id: I778bb2bcb9e11185357093c59fc1fa3f6caa26a1
2016-05-17 17:36:51 -07:00
Tavis Bohne ca5fc9fa7d Merge "Messaging doesn't allow sharing of its own files" into nyc-dev 2016-05-16 18:14:20 +00:00
Tony Mak c4073ff4ce Add badge icon for work contact in search result
BUG=26021888
BUG=28016344
(cherry picked from commit 6e00763823cd1b27ff88d25d0eb11f8addc3b2e6)

Change-Id: If0e2f7b1c58cd064ebfdae8a9b735b391c5009fc
2016-05-16 16:35:06 +01:00
Tony Mak e2ccf8bff5 Cleanup enterprise feature in ContactUtil
1. Remove isWorkProfileSupported checking, api level checking is enough.
2. Replace the hardcoded uri with the corresponding api.

BUG=26797244
BUG=28016344
(cherry picked from commit 0d7a1cce157e4ffb26d5fefb9908bbeffcb1d03c)

Change-Id: I76edad19dc6a19aa77b523cb960f716fca08944d
2016-05-16 16:34:58 +01:00
Tony Mak 9045160771 Separate work and personal contacts search result
This change allows sms app to show search result of different directories
in different partitions.
Currently, only personal default and enterprise default directory are
searched.

BUG=26021888
BUG=28016344
(cherry picked from commit 59666b32c192bd28807ccd2f9153c796668bdf13)

Change-Id: I733ceaae806d13661861126ce61c34108ac7e662
2016-05-16 16:34:43 +01:00
Tony Mak b7fc988f23 Search enterprise directory as well in SMS app
TODO: Update the UI to show enterprise result separately (b/26021888)

Bug: 28016344, 25977180
(cherry picked from commit 5c621e57256f5068a43f1456f9bab1194f0d27b2)

Change-Id: I7130ae5e057ed750a29f64c5497a04b868613579
2016-05-16 16:34:24 +01:00
Victor Chang 0a85b81c9f Add isAtLeastN in OsUtil
Bug: 28016344
Change-Id: I431b4fed3f2114d1f1b311416a892f608a846e4c
2016-05-11 18:07:38 +01:00
Tavis Bohne 30fb338539 Messaging doesn't allow sharing of its own files
-Previously, Messaging allowed sharing of any file it had permission
 to reach. This meant that bad apps could share a link to
 file:///data/data/com.android.messaging/databases/bugle_db
 and Messaging would happily send all this sensitive information to
 the target. Worse, a bad app could share a softlink to this file,
 where the symlink was picture.jpg with the image/jpg type.
-Now, when sanitizing attachments, we make sure any filepaths don't
 lead to any Bugle-specific directories.
-getApplicationInfo().dataDir is a symlink to
 /data/data/com.android.messaging, and appears to be the
 only directory where we store personal data.
-Most apps share as contentUris, including Messaging, so Messaging
 can still share to itself.

Change-Id: Ic464bc1f099029a030793c478aaf88b957d8bad1
Fixes:28076752
2016-04-29 14:39:59 -07:00
Tom Taylor 7fe2fc9b2f Messaging app ClassCastException (DecorContext -> Activity) when SMSoIMS is initiated
Bug 27649619

Change-Id: I1c0de7c14abd255ceb9d61a377db3276c32fede0
2016-03-21 13:44:13 -07:00
Shri Borde eba0949bc6 Access incoming audio files after user taps Play
For platforms with insecure handling of media files, media files should
be opened only after the user chooses to play the media.

Change-Id: I5f9bbd1f8468a704a5962f0dddd3c8b11bba8bea
2015-08-21 10:17:46 -07:00
Mike Dodd d4b7315d55 Fix build for latest Guava.
b/23110861

Change-Id: Iccd6e66f996fd00880cc3024085c838235da0adb
2015-08-12 15:11:43 -07:00
Mike Dodd d3b009ae55 Initial checkin of AOSP Messaging app.
b/23110861

Change-Id: I11db999bd10656801e618f78ab2b2ef74136fff1
2015-08-12 12:47:26 -07:00
Mike Dodd ef8c7abbcf Revert "Initial checkin of AOSP Messaging app."
This reverts commit 461a34b466.

Change-Id: Iac4ca77eeaa94989e91dead49a7959c905bd3078
2015-08-12 18:48:39 +00:00
Mike Dodd 461a34b466 Initial checkin of AOSP Messaging app.
b/23110861

Change-Id: I9aa980d7569247d6b2ca78f5dcb4502e1eaadb8a
2015-08-12 08:58:28 -07:00