Skip to content

Commit d9166ba

Browse files
committed
Check the proper file for bug 23881715
1 parent bdd3112 commit d9166ba

File tree

1 file changed

+23
-3
lines changed
  • app/src/main/java/fuzion24/device/vulnerability/vulnerabilities/framework/media

1 file changed

+23
-3
lines changed

app/src/main/java/fuzion24/device/vulnerability/vulnerabilities/framework/media/CVE_2015_6608.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.content.Context;
44
import android.os.Build;
5+
import android.util.Log;
56

67
import java.io.ByteArrayOutputStream;
78
import java.io.File;
@@ -32,6 +33,8 @@
3233

3334
public class CVE_2015_6608 implements VulnerabilityTest {
3435

36+
private static final String TAG = "CVE-2015-6608";
37+
3538
@Override
3639
public String getCVEorID() {
3740
return "CVE-2015-6608";
@@ -50,6 +53,8 @@ public boolean isVulnerable(Context context) throws Exception {
5053

5154
File softAAClib = new File("/system/lib/libstagefright_soft_aacdec.so");
5255

56+
File libvorbisidec = new File("/system/lib/libvorbisidec.so");
57+
5358
if(!stagefrightlib.exists() || !stagefrightlib.isFile()){
5459
throw new Exception("libstagefright.so doesn't exist or is not a file");
5560
}
@@ -58,6 +63,11 @@ public boolean isVulnerable(Context context) throws Exception {
5863
throw new Exception("libstagefright_soft_aacdec.so does not exist");
5964
}
6065

66+
if(!libvorbisidec.exists()){
67+
throw new Exception("libvorbisidec.so does not exist");
68+
}
69+
70+
6171
ByteArrayOutputStream libStageFrightBAOS = new ByteArrayOutputStream((int)stagefrightlib.length());
6272
BinaryAssets.copy(new FileInputStream(stagefrightlib), libStageFrightBAOS);
6373
byte[] libstagefrightSO = libStageFrightBAOS.toByteArray();
@@ -67,15 +77,25 @@ public boolean isVulnerable(Context context) throws Exception {
6777
BinaryAssets.copy(new FileInputStream(softAAClib), libaacdecBAOS);
6878
byte[] libaacdecSO = libaacdecBAOS.toByteArray();
6979

80+
ByteArrayOutputStream libvorbisidecBAOS = new ByteArrayOutputStream((int)libvorbisidec.length());
81+
BinaryAssets.copy(new FileInputStream(libvorbisidec), libvorbisidecBAOS);
82+
byte[] libvorbisidecSO = libvorbisidecBAOS.toByteArray();
83+
84+
7085

7186
KMPMatch binMatcher = new KMPMatch();
7287

7388
int indexOf = binMatcher.indexOf(libstagefrightSO, "b/23680780".getBytes());
7489
boolean libstagefrightVulnerableToBug23680780 = indexOf == -1;
75-
indexOf = binMatcher.indexOf(libstagefrightSO, "b/23881715".getBytes());
90+
indexOf = binMatcher.indexOf(libvorbisidecSO, "b/23881715".getBytes());
7691
boolean libstagefrightvulnerableToBug23881715 = indexOf == -1;
7792
indexOf = binMatcher.indexOf(libaacdecSO, "b/23876444".getBytes());
78-
boolean libstagerightVulnerableToBug23876444 = indexOf == -1;
93+
boolean libstagefrightVulnerableToBug23876444 = indexOf == -1;
94+
95+
96+
Log.d(TAG, "libstagefrightVulnerableToBug23680780: " + libstagefrightVulnerableToBug23680780);
97+
Log.d(TAG, "libstagefrightvulnerableToBug23881715: " + libstagefrightvulnerableToBug23881715);
98+
Log.d(TAG, "libstagefrightVulnerableToBug23876444: " + libstagefrightVulnerableToBug23876444);
7999

80100
//Only affects L and M
81101
if(Build.VERSION.SDK_INT != Build.VERSION_CODES.M && Build.VERSION.SDK_INT != Build.VERSION_CODES.LOLLIPOP){
@@ -84,7 +104,7 @@ public boolean isVulnerable(Context context) throws Exception {
84104

85105
return libstagefrightVulnerableToBug23680780 ||
86106
libstagefrightvulnerableToBug23881715 ||
87-
libstagerightVulnerableToBug23876444;
107+
libstagefrightVulnerableToBug23876444;
88108

89109
}
90110

0 commit comments

Comments
 (0)