Andres Celis | d1927e8 | 2017-10-05 15:49:07 -0700 | [diff] [blame] | 1 | /** |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 2 | * Copyright (C) 2020 The Android Open Source Project |
Andres Celis | d1927e8 | 2017-10-05 15:49:07 -0700 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.security.cts; |
| 18 | |
| 19 | import android.platform.test.annotations.SecurityTest; |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 20 | import org.junit.Test; |
| 21 | import org.junit.runner.RunWith; |
| 22 | import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; |
Andres Celis | d1927e8 | 2017-10-05 15:49:07 -0700 | [diff] [blame] | 23 | |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 24 | import static org.junit.Assert.*; |
| 25 | |
| 26 | @RunWith(DeviceJUnit4ClassRunner.class) |
Andres Celis | d1927e8 | 2017-10-05 15:49:07 -0700 | [diff] [blame] | 27 | public class Poc17_11 extends SecurityTestCase { |
| 28 | |
| 29 | /** |
Andres Celis | 52a8b0a | 2017-10-18 09:19:25 -0700 | [diff] [blame] | 30 | * b/36075131 |
| 31 | */ |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 32 | @Test |
Max Spector | 6962ed7 | 2018-11-06 20:41:57 -0800 | [diff] [blame] | 33 | @SecurityTest(minPatchLevel = "2017-11") |
Andres Celis | 52a8b0a | 2017-10-18 09:19:25 -0700 | [diff] [blame] | 34 | public void testPocCVE_2017_0859() throws Exception { |
| 35 | AdbUtils.runCommandLine("logcat -c", getDevice()); |
| 36 | AdbUtils.pushResource("/cve_2017_0859.mp4", "/sdcard/cve_2017_0859.mp4", getDevice()); |
| 37 | AdbUtils.runCommandLine("am start -a android.intent.action.VIEW " + |
| 38 | "-d file:///sdcard/cve_2017_0859.mp4" + |
| 39 | " -t audio/amr", getDevice()); |
| 40 | // Wait for intent to be processed before checking logcat |
| 41 | Thread.sleep(5000); |
Christopher Dombroski | 0b5e86a | 2019-07-25 16:48:56 -0700 | [diff] [blame] | 42 | AdbUtils.assertNoCrashes(getDevice(), "mediaserver"); |
Andres Celis | 52a8b0a | 2017-10-18 09:19:25 -0700 | [diff] [blame] | 43 | } |
Andres Celis | d1927e8 | 2017-10-05 15:49:07 -0700 | [diff] [blame] | 44 | } |