27

I just received an email from Google play stating:

Hello,

One or more of your apps is running an outdated version of OpenSSL, which has multiple security vulnerabilities. You should update OpenSSL as soon as possible. For more information about the most recent security vulnerability in OpenSSL, please see http://www.openssl.org/news/secadv_20140605.txt.

Please note, while it's unclear whether these specific issues affect your application, applications with vulnerabilities that expose users to risk of compromise may be considered “dangerous products” and subject to removal from Google Play.

Regards,

Google Play Team

©2014 Google Inc. 1600 Amphitheatre Parkway Mountain View, CA 94043

Email preferences: You have received this mandatory email service announcement to update you about important changes to your Google Play account.

I have not explicitely included OpenSSL in any of my apps. The apps which use the Android NDK are using NDK 9d (the latest). The only external native libraries I do use are ffmpeg and OpenCV and some advertising libraries which do not have native code included.

Where else could OpenSSL be included causing this warning?

Regards,

jww
  • 97,681
  • 90
  • 411
  • 885
Hyndrix
  • 4,282
  • 7
  • 41
  • 82
  • I also got this email this morning. This means everyone that have some login process might need to update to the latest sdk ? I haven't included any Open SSL library neither, but maybe it's about the java.security package that i'm using for password hash, maybe you also use something like this ? – Jissay Jun 13 '14 at 07:53
  • I'll update my libraries (maybe Twilio or Amazon's AWS SDK for Android make use of that) but after that, I'm not really sure how to proceed. Would there be anything else on my end to update? Servers by AWS are updated and fixed automatically as far as I know. But client side..? – Armando Jun 13 '14 at 15:59
  • @Hyndrix - can you navigate to the email, show the message headers, and then paste the message headers into the question? Google still has not discussed these findings (I just checked their security blog at http://googleonlinesecurity.blogspot.com/), and I'm wondering if its really from Google or a hoax by someone. – jww Jun 13 '14 at 19:34
  • Also got this messaeg. But can't figure out where am I using OpenSSL. – Lingviston Dec 18 '14 at 10:00
  • 1
    Could it be the developer certificate was created using an old openssl version? – Delcasda Dec 18 '14 at 13:28
  • For me, it seems related to the Google IMA. I ran the provided command against the APK generated by the **SampleVideoPlayer** APK and it said `GmsCore_OpenSSL`. Or did I receive the email by mistake? – Sufian Jun 24 '15 at 07:59
  • @Hyndrix hi! i am also facing same issue, you got solution? – Aamirkhan Jun 29 '15 at 12:40
  • @Aamirkhan I created a thread on [Google Groups](https://groups.google.com/forum/#!topic/mailing.openssl.users/Xcf1O4qRPB0). I still haven't received an answer from Google though. – Sufian Jul 07 '15 at 11:34

5 Answers5

21

I wrote a bash script which will display the OpenSSL versions of anything statically linked in your app and whether TLS heartbeat methods are included.

This worked on a handful of APKs I threw at it. The OpenSSL version string is being specifically extracted with a version number and date. If Google flags the APK and this can't find it, relax the OpenSSL regex in the egrep command to just "OpenSSL" and see where that gets you.

Put the following in a file e.g. testopenssl.sh

usage: ./testopenssl.sh APK_File

#!/bin/bash
sslworkdir="ssl_work_dir"
if [ ! -d $sslworkdir ]; then
  mkdir $sslworkdir
fi
unzip -q "$1" -d $sslworkdir
#Set delimiter to ignore spaces
IFS=$'\r\n'
#Create an array of OpenSSL version strings
opensslarr=($(egrep --binary-files=text -o -R -e "OpenSSL\s\d+\.\d+\.\d+\w+\s\d+\s\w+\s\d+" $sslworkdir/*))
#Stackoverflow syntax highlight fix closing 'block comment' */
if [ ${#opensslarr[@]} -gt 0 ]; then
    echo "Found OpenSSL versions"
    printf "%s\n" "${opensslarr[@]}"
    heartbeatarr=($(grep -R -E "(tls1_process_heartbeat|dtls1_process_heartbeat|dtls1_heartbeat|tls1_hearbeat)" $sslworkdir/*))
    #Stackoverflow syntax highlight fix closing 'block comment' */
    if [ ${#heartbeatarr[@]} -gt 0 ]; then
        echo "Files that contains heartbeat methods:"
    printf "%s\n" "${heartbeatarr[@]}"
    else
        echo "No libraries contain heartbeat methods"
    fi
else
    echo "Did not find OpenSSL"
fi
rm -rf $sslworkdir
caller9
  • 2,207
  • 1
  • 18
  • 11
  • 1
    Hi, I am using Cordova library and google already pointed my apk. This script couldnt find any OpenSSL. Is there anyway to test it? – Emre Aktürk Jan 21 '15 at 11:14
  • I run the above script in my Mac machine but it's giving me the following error: `testopenssl.sh: line 27: syntax error: unexpected end of file`. Also I am able to run `"$ unzip -p YourApp.apk | strings | grep "OpenSSL"` on my Mac shell. and it's giving me the OpenSSL versions "0.9.8h May 2008". But now what to do next? How to fix this or upgrade to latest OpenSSL version and deploy it on Google Play? – YuDroid Mar 04 '15 at 06:18
  • The script wasn't able to find OpenSSL on the .apk; but I'm still getting the warning from google play. When I run the grep command, it did not give me the OpenSSL versions. I got the following result --> Failed to seed OpenSSL PRNG GmsCore_OpenSSL +com.android.org.conscrypt.OpenSSLSocketImpl 7org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl Any ideas of what I could be missing? – user1743524 Sep 28 '15 at 18:24
  • I'm getting this error when trying to run this script `testopenssl.sh: line 1: {rtf1ansiansicpg122cocoartf14204cocoasubrtf40: command not found testopenssl.sh: line 2: syntax error near unexpected token `}' testopenssl.sh: line 2: `{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;}'` I'm not explicitly using OpenSSL library and I cannot find this library in any of my dependencies (in dependency tree). – Stepan Sanda Apr 06 '16 at 07:49
  • rm: ssl_work_dir/realestate: Permission denied rm: ssl_work_dir/base/res: Permission denied rm: ssl_work_dir/base: Permission denied rm: ssl_work_dir: Permission denied – Maveňツ Oct 10 '22 at 05:48
8

According to Eric Davis on the Android Security Discussions mailing list in response to Security Alert: You are using a highly vulnerable version of OpenSSL:

  1. You can determine which apps are using OpenSSL via ("$ unzip -p YourApp.apk | strings | grep "OpenSSL"")
  2. Please update all statically linked versions of OpenSSL to 1.0.1h, 1.0.0m, or 0.9.8za. (Note by jww: this version will change over time as new versions of OpenSSL are released).
  3. If you are using a 3rd party library that bundles OpenSSL, please notify the 3rd party and work with them to address this.

When you get this message, you should update both the NDK and IDE you are using. I've seen reports of some versions of the NDK including a downlevel header. I also suspect the IDE you are using could be providing a downlevel OpenSSL version (I don't use the IDEs on Android, so I have not encountered it).

If you are not directly using OpenSSL, then the SDKs are providing the vulnerable version of OpenSSL. In this case, you should update your SDKs. If you need to locate the downlevel OpenSSL among SDKs, then see How to check which dependancy causes OpenSSL vulnerability.

Google also provides Updating Your Security Provider to Protect Against SSL Exploits, but I suspect it will still trigger the message because it appears to be a basic string search.

Its often easier to update everything rather than trying to figure out who is providing the down level version of OpenSSL. After you spend the time to determine who is providing it, your actionable item is the same: update the SDK. So why waste time on it; just update all of them and enjoy the other bug fixes, too.


There are still open questions, though: if one uses the cryptography from libcrypto (for example (RAND_bytes or EVP_encrypt) and not the SSL/TLS functions from libssl (for example, SSL_connect), will it still trigger the warning? That is, is Google scanning for use of vulnerable functions, or is Google scanning for OpenSSL version via strings.

Community
  • 1
  • 1
jww
  • 97,681
  • 90
  • 411
  • 885
  • 1
    the solution u have given here can be done on linux, Can u please tell me how to do the same on windows?. I'm using twillio in my app, so is that the reason that this message is being thrown up? How should i check my android studio project for this open ssl? – UserName_Untold Apr 04 '16 at 07:11
  • In my case "..x86/librealm-jni.so" has old openSSL version. How do i fix this? – M. Usman Khan Oct 04 '20 at 18:37
2

I also have this problem because the version of Facebook's SDK I am using is not updated. So if you are using it too, just try to use the updated version of Facebook's SDK v3.21.1, and that warning is solved.

kads
  • 112
  • 1
  • 10
1

If you are using cocos2dx then you need to update curl library. Please download updated curl library from here http://cocostudio.download.appget.cn/Cocos2D-X/curl.zip

and replace it with current curl library present in cocos2dx.

For safe side please update your mac openssl version also, for this follow this link http://javigon.com/2014/04/09/update-openssl-in-osx/

Ali Raza
  • 613
  • 5
  • 17
0

I had this issue, I am using ffmpeg lib and .so files, I resolved issue by below steps: First, I use Android Studio. So, if you're using Eclipse, try to find your own way.

The cause of the issue is the libavformat.so file which is using OpenSSL 1.0.2d. We need to update it. But, just updating libavformat.so will cause crashing, so we need to update all relating lib (javacv and javacpp).

  • Download javacv-1.2-bin.zip and javacpp-1.2.3-bin.zip from https://github.com/bytedeco/javacv and https://github.com/bytedeco/javacpp

  • Extract them and copy ffmpeg.jar, javacpp.jar, javacv.jar and opencv.jar to [yourproject]\libs.

  • Extract ffmpeg-android-arm.jar and opencv-android-arm.jar (find them after extracting javacv-1.2-bin.zip), you will collect new version of .so files.
  • Replace the old files in [yourproject]\src\main\jniLibs\armeabi-v7a with new version (just almost .so files will be replaced, not all of them)
  • Sometimes, you need to copy javacpp-presets-1.2.pom file to [yourproject]\libs, too. You can search it on Google.
  • Modify the module build.gradle of your project

    apply plugin: 'com.android.library'
    android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    
    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 23
    }
    
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    
        }
    }
    
    
        packagingOptions {
        exclude 'META-INF/services/javax.annotation.processing.Processor'
        pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
        pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
        pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
        pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
        pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
        pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/1.2/javacpp-presets-1.2.pom.xml'
        pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/org.bytedeco.javacpp-presets-1.2.pom.xml'
    }
      }
    
      configurations {
    all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
    }
      repositories {
    mavenCentral()
    }
    
    dependencies {
    compile 'com.android.support:support-v4:23.2.1'
    compile files('libs/opencv.jar') //1.2
    compile files('libs/javacv.jar') //1.2
    compile files('libs/javacpp.jar') //1.2.3
    compile files('libs/ffmpeg.jar') //1.2
    }
    
  • Clean project and rebuild.

Reference- kieukhuongthinh's comment

Kalu Khan Luhar
  • 1,044
  • 1
  • 22
  • 35