漏洞分析

0

高危漏洞

6

中危漏洞

3

低危漏洞

7

警告

文件名 一体机安装包.apk
上传者 as3usk
文件大小 13.564504623413MB
MD5 0b5150927ed351aca4448fe30dfc2c33
包名 com.bqhealth.healthone
Main Activity com.bqhealth.healthone.activities.InitializeActivity
Min SDK 16
Target SDK 22

权限列表

# 名称 说明 提示
0 android.permission.ACCESS_FINE_LOCATION 访问精准的位置源,例如手机上的全球定位系统(如果有)。恶意应用程序可能会借此确定您所处的位置,并可能消耗额外的电池电量。 注意
1 android.permission.READ_PHONE_STATE 允许应用程序访问设备的手机功能。有此权限的应用程序可确定此手机的号码和序列号,是否正在通话,以及对方的号码等。 注意
2 android.permission.SYSTEM_ALERT_WINDOW 允许应用程序显示系统警报窗口。恶意应用程序可借此掌控整个手机屏幕。 注意
3 android.permission.ACCESS_NETWORK_STATE 允许应用程序查看所有网络的状态。 提示
4 android.permission.ACCESS_WIFI_STATE 允许应用程序查看有关WLAN状态的信息。 提示
5 android.permission.CAMERA 允许应用程序使用相机拍照,这样应用程序可随时收集进入相机镜头的图像。 提示
6 android.permission.INTERNET 允许程序访问网络. 提示
7 android.permission.WRITE_EXTERNAL_STORAGE 允许应用程序写入SD卡。 提示

四大组件

组件名称

com.bqhealth.healthone.MainActivity
com.facebook.react.devsupport.DevSettingsActivity
com.bqhealth.healthone.activities.ECGWareActivity
com.bqhealth.healthone.activities.SPO2WareActivity
com.bqhealth.healthone.activities.InitializeActivity

com.konsung.service.AIDLServer

com.imagepicker.FileProvider

第三方库

# 库名 介绍
0 com.google.gson A Java serialization library that can convert Java Objects into JSON and back.
1 retrofit2 Type-safe REST client for Android and Java by Square, Inc.
2 com.facebook.cache.common An image management library by FaceBook.
3 com.orhanobut.logger Simple, pretty and powerful logger for android
4 com.facebook.imagepipeline An image management library by FaceBook.
5 android.support.multidex DEPRECATED
6 retrofit2 Type-safe REST client for Android and Java by Square, Inc.
7 okhttp3 An HTTP+SPDY client for Android and Java applications.

静态扫描发现风险点

风险等级 风险名称

中危

检测到当前标志被设置成true或没设置,这会导致adb调试备份允许恶意攻击者复制应用程序数据,造成数据泄露。

中危

检测到1处继承了PreferenceActivity的activity类没有覆盖isValidFragment或者覆盖了isValidFragment但直接返回true没有检查。
在api level 小于19的app,所有继承了PreferenceActivity类的activity并将该类置为exported的应用都受到Fragment注入漏洞的威胁。
Google在 Android 4.4 KitKat 里面修正了该问题,引入了PreferenceActivity.isValidFragment函数,要求用户重写该函数验证Fragment来源正确性。

参考资料:
http://wolfeye.baidu.com/blog/android-fragment-injection/


位置: classes.dex
com.facebook.react.devsupport.DevSettingsActivity

中危

该app需要移除大部分日志打印代码。
经扫描该包仍存在大量打日志代码,共发现57处打日志代码.(此处扫描的日志打印代码,是指调用android.util.Log.* 打印的.)
详情如下:

位置: classes.dex
com.konsung.util.LogUtils;->e(Ljava/lang/String;)V==>android.util.Log;->e(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.soloader.UnpackingSoSource;->regenerate(B Lcom/facebook/soloader/UnpackingSoSource$DsoManifest; Lcom/facebook/soloader/UnpackingSoSource$InputDsoIterator;)V==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I
com.bqhealth.healthonelib.dbdao.DaoMaster$OpenHelper;->onCreate(Lorg/greenrobot/greendao/database/Database;)V==>android.util.Log;->i(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.bridge.CatalystInstanceImpl;->(Lcom/facebook/react/bridge/queue/ReactQueueConfigurationSpec; Lcom/facebook/react/bridge/JavaScriptExecutor; Lcom/facebook/react/bridge/NativeModuleRegistry; Lcom/facebook/react/bridge/JSBundleLoader; Lcom/facebook/react/bridge/NativeModuleCallExceptionHandler;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.net.EchoClient;->start()V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.bqhealth.healthonelib.devices.DeviceManager;->debugInfo(Ljava/lang/String;)V==>android.util.Log;->i(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->recreateReactContextInBackgroundFromBundleLoader()V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.bqhealth.healthonelib.Debug;->LogDebug(Ljava/lang/String;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->detachViewFromInstance(Lcom/facebook/react/ReactRootView; Lcom/facebook/react/bridge/CatalystInstance;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.horcrux.svg.SvgView;->dispatchCancelEvent(Landroid/view/MotionEvent;)V==>android.util.Log;->w(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.views.scroll.ReactScrollView;->(Lcom/facebook/react/bridge/ReactContext; Lcom/facebook/react/views/scroll/FpsListener;)V==>android.util.Log;->w(Ljava/lang/String; Ljava/lang/String;)I
com.bqhealth.healthonelib.utils.SDCardDatabaseContext;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;==>android.util.Log;->e(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.soloader.UnpackingSoSource;->refreshLocked(Lcom/facebook/soloader/FileLocker; I [B)Z==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.soloader.UnpackingSoSource;->extractDso(Lcom/facebook/soloader/UnpackingSoSource$InputDso; [B)V==>android.util.Log;->i(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.service.AIDLServer;->onCreate()V==>android.util.Log;->e(Ljava/lang/String; Ljava/lang/String;)I
com.horcrux.svg.SvgView;->handleTouchEvent(Landroid/view/MotionEvent;)V==>android.util.Log;->w(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.util.UiUtils$1$1;->send12LeadDiaResult([B)V==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.imagepipeline.memory.NativeMemoryChunk;->copy(I Lcom/facebook/imagepipeline/memory/NativeMemoryChunk; I I)V==>android.util.Log;->w(Ljava/lang/String; Ljava/lang/String;)I
com.horcrux.svg.SvgView;->handleTouchEvent(Landroid/view/MotionEvent;)V==>android.util.Log;->e(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->attachRootViewToInstance(Lcom/facebook/react/ReactRootView; Lcom/facebook/react/bridge/CatalystInstance;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.bqhealth.healthonelib.dbdao.DaoMaster$DevOpenHelper;->onUpgrade(Lorg/greenrobot/greendao/database/Database; I I)V==>android.util.Log;->i(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.net.EchoServerDecoder;->handlerBlogicCheckInfo(Lio/netty/buffer/ByteBuf; I)V==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.soloader.UnpackingSoSource$1;->run()V==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.util.LogUtils;->i(Ljava/lang/String;)V==>android.util.Log;->i(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.soloader.UnpackingSoSource;->prepare(I)V==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.soloader.ApkSoSource$ApkUnpacker;->shouldExtract(Ljava/util/zip/ZipEntry; Ljava/lang/String;)Z==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->(Landroid/content/Context; Landroid/app/Activity; Lcom/facebook/react/modules/core/DefaultHardwareBackBtnHandler; Lcom/facebook/react/bridge/JavaScriptExecutorFactory; Lcom/facebook/react/bridge/JSBundleLoader; Ljava/lang/String; Ljava/util/List; Z Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener; Lcom/facebook/react/common/LifecycleState; Lcom/facebook/react/uimanager/UIImplementationProvider; Lcom/facebook/react/bridge/NativeModuleCallExceptionHandler; Lcom/facebook/react/devsupport/RedBoxHandler; Z Z Z Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener; Z I Z Z I)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->onReloadWithJSDebugger(Lcom/facebook/react/bridge/JavaJSExecutor$Factory;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.bqhealth.healthonelib.utils.AESHelper;->AESCipher(I Ljava/lang/String; Ljava/lang/String; Ljava/lang/String;)Z==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.imagepicker.utils.MediaUtils$1;->onScanCompleted(Ljava/lang/String; Landroid/net/Uri;)V==>android.util.Log;->i(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->setupReactContext(Lcom/facebook/react/bridge/ReactApplicationContext;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.soloader.UnpackingSoSource;->deleteUnmentionedFiles([Lcom/facebook/soloader/UnpackingSoSource$Dso;)V==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.util.LogUtils;->d(Ljava/lang/String;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->tearDownReactContext(Lcom/facebook/react/bridge/ReactContext;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->onJSBundleLoadedFromServer()V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->createReactContextInBackground()V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.bridge.CatalystInstanceImpl$1$1;->run()V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->recreateReactContextInBackgroundInner()V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.bqhealth.apitool.downloader.JsResponseBody$1;->read(Lokio/Buffer; J)J==>android.util.Log;->e(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.bridge.CatalystInstanceImpl;->runJSBundle()V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.service.AIDLServer$2;->run()V==>android.util.Log;->e(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.imagepipeline.memory.NativeMemoryChunk;->finalize()V==>android.util.Log;->w(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.util.LogUtils;->v(Ljava/lang/String;)V==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.bridge.CatalystInstanceImpl;->initialize()V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->recreateReactContextInBackground(Lcom/facebook/react/bridge/JavaScriptExecutorFactory; Lcom/facebook/react/bridge/JSBundleLoader;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->createReactContext(Lcom/facebook/react/bridge/JavaScriptExecutor; Lcom/facebook/react/bridge/JSBundleLoader;)Lcom/facebook/react/bridge/ReactApplicationContext;==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.ReactInstanceManager;->runCreateReactContextOnNewThread(Lcom/facebook/react/ReactInstanceManager$ReactContextInitParams;)V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.flat.FlatARTSurfaceViewShadowNode;->drawOutput()V==>android.util.Log;->e(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.soloader.UnpackingSoSource;->prepare(I)V==>android.util.Log;->i(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.util.LogUtils;->w(Ljava/lang/String;)V==>android.util.Log;->w(Ljava/lang/String; Ljava/lang/String;)I
com.facebook.react.bridge.CatalystInstanceImpl;->destroy()V==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I
com.konsung.util.UiUtils;->printHexString([B)V==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I

位置: classes2.dex
org.greenrobot.greendao.DaoLog;->e(Ljava/lang/String;)I==>android.util.Log;->w(Ljava/lang/String; Ljava/lang/String;)I
org.greenrobot.greendao.DaoLog;->i(Ljava/lang/String;)I==>android.util.Log;->i(Ljava/lang/String; Ljava/lang/String;)I
org.greenrobot.greendao.DaoLog;->v(Ljava/lang/String;)I==>android.util.Log;->v(Ljava/lang/String; Ljava/lang/String;)I
org.greenrobot.greendao.DaoLog;->w(Ljava/lang/String;)I==>android.util.Log;->w(Ljava/lang/String; Ljava/lang/String;)I
org.greenrobot.greendao.DaoLog;->d(Ljava/lang/String;)I==>android.util.Log;->d(Ljava/lang/String; Ljava/lang/String;)I

中危

检测到1个WebView远程执行漏洞。

位置: classes.dex
com.facebook.react.views.webview.ReactWebViewManager$ReactWebView;->setMessagingEnabled(Z)V

Android API < 17之前版本存在远程代码执行安全漏洞,该漏洞源于程序没有正确限制使用addJavaScriptInterface方法,攻击者可以通过Java反射利用该漏洞执行任意Java对象的方法,导致远程代码执行安全漏洞。
(1)API等于高于17的Android系统。出于安全考虑,为了防止Java层的函数被随意调用,Google在4.2版本之后,规定允许被调用的函数必须以@JavascriptInterface进行注解。
(2)API等于高于17的Android系统。建议不要使用addJavascriptInterface接口,以免带来不必要的安全隐患,如果一定要使用该接口,建议使用证书校验。
(3)使用removeJavascriptInterface移除Android系统内部的默认内置接口:searchBoxJavaBridge_、accessibility、accessibilityTraversal。

参考案例:
www.wooyun.org/bugs/wooyun-2015-0140708
www.wooyun.org/bugs/wooyun-2016-0188252
http://drops.wooyun.org/papers/548

参考资料:
http://jaq.alibaba.com/blog.htm?id=48
http://blog.nsfocus.net/android-webview-remote-code-execution-vulnerability-analysis
https://developer.android.com/reference/android/webkit/WebView.html

中危

检测到37条敏感明文信息,建议移除。

位置: classes.dex
'10.0.2.2' used in: Lcom/facebook/react/modules/systeminfo/AndroidInfoHelpers;->getServerIpAddress(I)Ljava/lang/String;
'10.0.3.2' used in: Lcom/facebook/react/modules/systeminfo/AndroidInfoHelpers;->getServerIpAddress(I)Ljava/lang/String;
'http://%s/%s' used in: Lcom/facebook/react/devsupport/DevServerHelper;->createResourceURL(Ljava/lang/String; Ljava/lang/String;)Ljava/lang/String;
'http://%s/%s.bundle?platform=android&dev=%s&minify=%s' used in: Lcom/facebook/react/devsupport/DevServerHelper;->()V
'http://%s/%s.bundle?platform=android&dev=%s&minify=%s' used in: Lcom/facebook/react/devsupport/DevServerHelper;->getSourceUrl(Ljava/lang/String;)Ljava/lang/String;
'http://%s/%s.bundle?platform=android&dev=%s&minify=%s' used in: Lcom/facebook/react/devsupport/DevServerHelper;->createBundleURL(Ljava/lang/String; Ljava/lang/String; Z Z)Ljava/lang/String;
'http://%s/inspector/device?name=%s&app=%s' used in: Lcom/facebook/react/devsupport/DevServerHelper;->getInspectorDeviceUrl()Ljava/lang/String;
'http://%s/jscheapcaptureupload' used in: Lcom/facebook/react/devsupport/DevServerHelper;->getHeapCaptureUploadUrl()Ljava/lang/String;
'http://%s/launch-js-devtools' used in: Lcom/facebook/react/devsupport/DevServerHelper;->createLaunchJSDevtoolsCommandUrl()Ljava/lang/String;
'http://%s/onchange' used in: Lcom/facebook/react/devsupport/DevServerHelper;->createOnChangeEndpointUrl()Ljava/lang/String;
'http://%s/open-stack-frame' used in: Lcom/facebook/react/devsupport/DevServerHelper;->createOpenStackFrameURL(Ljava/lang/String;)Ljava/lang/String;
'http://%s/status' used in: Lcom/facebook/react/devsupport/DevServerHelper;->createPackagerStatusURL(Ljava/lang/String;)Ljava/lang/String;
'http://%s/symbolicate' used in: Lcom/facebook/react/devsupport/DevServerHelper;->createSymbolicateURL(Ljava/lang/String;)Ljava/lang/String;
'http://10.2.1.242:84/' used in: Lcom/bqhealth/apitool/ApiManager;->getApiService()Lcom/bqhealth/apitool/ApiService;
'http://10.2.1.242:84/' used in: Lcom/bqhealth/healthone/activities/InitializeActivity;->onCreate(Landroid/os/Bundle;)V
'http://10.2.1.242:84/' used in: Lcom/bqhealth/healthone/react/modules/AppSettingNativeModule;->downloadFile(Lcom/bqhealth/apitool/VersionInfo;)V
'http://10.2.1.242:84/' used in: Lcom/bqhealth/apitool/ApiManager;->getApiService()Lcom/bqhealth/apitool/ApiService;
'http://10.2.1.242:84/' used in: Lcom/bqhealth/healthone/activities/InitializeActivity;->onCreate(Landroid/os/Bundle;)V
'http://10.2.1.242:84/' used in: Lcom/bqhealth/healthone/react/modules/AppSettingNativeModule;->downloadFile(Lcom/bqhealth/apitool/VersionInfo;)V
'http://10.2.1.242:85/' used in: Lcom/bqhealth/healthone/activities/InitializeActivity;->onCreate(Landroid/os/Bundle;)V
'http://10.2.1.242:85/' used in: Lcom/bqhealth/apitool/ApiManager;->getFileApiService()Lcom/bqhealth/apitool/FileApiService;
'http://10.2.1.242:85/' used in: Lcom/bqhealth/healthone/activities/InitializeActivity;->onCreate(Landroid/os/Bundle;)V
'http://10.2.1.242:85/' used in: Lcom/bqhealth/apitool/ApiManager;->getFileApiService()Lcom/bqhealth/apitool/FileApiService;
'http://freemarker.org/' used in: Lfreemarker/core/CommandLine;->main([Ljava/lang/String;)V
'http://java.sun.com/dtd/web-app_2_3.dtd' used in: Lfreemarker/ext/jsp/TaglibFactory$LocalDtdEntityResolver;->()V
'http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd' used in: Lfreemarker/ext/jsp/TaglibFactory$LocalDtdEntityResolver;->()V
'http://java.sun.com/j2ee/dtds/web-app_2_2.dtd' used in: Lfreemarker/ext/jsp/TaglibFactory$LocalDtdEntityResolver;->()V
'http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd' used in: Lfreemarker/ext/jsp/TaglibFactory$LocalDtdEntityResolver;->()V
'http://schemas.android.com/apk/res/android' used in: Landroid/support/graphics/drawable/TypedArrayUtils;->hasAttribute(Lorg/xmlpull/v1/XmlPullParser; Ljava/lang/String;)Z
'http://www.android.com/' used in: Lcom/facebook/soloader/SoLoader;->loadLibrary(Ljava/lang/String;)V
'http://www.w3.org/XML/1998/namespace' used in: Lfreemarker/ext/xml/Namespaces;->()V
'javascript:(function () {var event;var data = ' used in: Lcom/facebook/react/views/webview/ReactWebViewManager;->receiveCommand(Landroid/webkit/WebView; I Lcom/facebook/react/bridge/ReadableArray;)V
'javascript:(function() {\n' used in: Lcom/facebook/react/views/webview/ReactWebViewManager$ReactWebView;->callInjectedJavaScript()V
'javascript:(window.originalPostMessage = window.postMessage,window.postMessage = function(data) {__REACT_WEB_VIEW_BRIDGE.postMessage(String(data));})' used in: Lcom/facebook/react/views/webview/ReactWebViewManager$ReactWebView;->linkBridge()V

位置: classes2.dex
'http://localhost/' used in: Lretrofit2/Response;->success(Ljava/lang/Object;)Lretrofit2/Response;
'http://localhost/' used in: Lretrofit2/Response;->success(Ljava/lang/Object; Lokhttp3/Headers;)Lretrofit2/Response;
'http://localhost/' used in: Lretrofit2/Response;->error(I Lokhttp3/ResponseBody;)Lretrofit2/Response;

中危

检测到2处setSavePassword密码明文存储漏洞。

位置: classes.dex
com.facebook.react.views.webview.ReactWebViewManager;
com.facebook.react.views.webview.ReactWebViewManager$ReactWebView;

webview的保存密码功能默认设置为true。Webview会明文保存网站上的密码到本地私有文件”databases/webview.db”中。对于可以被root的系统环境或者配合其他漏洞(如webview的同源绕过漏洞),攻击者可以获取到用户密码。
建议:显示设置webView.getSetting().setSavePassword(false)。

参考案例:
www.wooyun.org/bugs/wooyun-2010-021420
www.wooyun.org/bugs/wooyun-2013-020246

参考资料:
http://wolfeye.baidu.com/blog/
www.claudxiao.net/2013/03/android-webview-cache/

低危

检测到1处SecureRandom使用不当。

位置: classes.dex
com.bqhealth.healthonelib.utils.AESHelper;->getRawKey

SecureRandom的使用不当会导致生成的随机数可被预测,该漏洞存在于Android系统随机生成数字串安全密钥的环节中。该漏洞的生成原因是对SecureRandom类的不正确使用方式导致生成的随机数不随机。建议:
(1)不要使用自定义随机源代替系统默认随机源(推荐)除非有特殊需求,在使用SecureRandom类时,不要调用以下函数:SecureRandom类下SecureRandom(byte[]seed)、setSeed(long seed)和setSeed(byte[]seed)方法。
(2)在调用setSeed方法前先调用任意nextXXX方法。具体做法是调用setSeed方法前先调用一次SecureRandom#nextBytes(byte[]bytes)方法,可以避免默认随机源被替代,详细见参考资料。

参考资料:
https://developer.android.com/reference/java/security/SecureRandom.html
http://drops.wooyun.org/papers/5164
http://jaq.alibaba.com/blog.htm?id=47

低危

检测到9个WebView系统隐藏接口未移除。

位置: classes.dex
com.facebook.react.views.webview.ReactWebViewManager;->setScalesPageToFit(Landroid.webkit.WebView; Z)V
com.facebook.react.views.webview.ReactWebViewManager;->setJavaScriptEnabled(Landroid.webkit.WebView; Z)V
com.facebook.react.views.webview.ReactWebViewManager;->setDomStorageEnabled(Landroid.webkit.WebView; Z)V
com.facebook.react.views.webview.ReactWebViewManager;->setMediaPlaybackRequiresUserAction(Landroid.webkit.WebView; Z)V
com.facebook.react.views.webview.ReactWebViewManager;->setUserAgent(Landroid.webkit.WebView; Ljava.lang.String;)V
com.facebook.react.views.webview.ReactWebViewManager;->setSaveFormDataDisabled(Landroid.webkit.WebView; Z)V
com.facebook.react.views.webview.ReactWebViewManager;->setMixedContentMode(Landroid.webkit.WebView; Ljava.lang.String;)V
com.facebook.react.views.webview.ReactWebViewManager;->setSource(Landroid.webkit.WebView; Lcom.facebook.react.bridge.ReadableMap;)V
com.facebook.react.views.webview.ReactWebViewManager;->setAllowUniversalAccessFromFileURLs(Landroid.webkit.WebView; Z)V

android webview组件包含3个隐藏的系统接口:searchBoxJavaBridge_,accessibilityTraversal以及accessibility,恶意程序可以利用它们实现远程代码执行。
如果使用了WebView,那么使用WebView.removeJavascriptInterface(String name) API,显示的移除searchBoxJavaBridge_、accessibility、accessibilityTraversal这三个接口。

参考资料:
http://wolfeye.baidu.com/blog/android-webview/
http://blog.csdn.net/u013107656/article/details/51729398
http://wolfeye.baidu.com/blog/android-webview-cve-2014-7224/

低危

非debug包,需要通过打包平台proguard脚本,移除大部分系统输出代码。
经扫描该包仍存在大量系统输出代码,共发现21处系统输出代码.(此处扫描的系统输出代码,是指调用System.out.print*输出的,本应在打包平台移除的系统输出代码.)
各个bundle系统输出代码详情如下:

位置: classes.dex
com.konsung.net.EchoServerEncoder;
com.bqhealth.healthonelib.Utils;
freemarker.template.utility.ToCanonical;
com.konsung.net.EchoServer;
com.bqhealth.healthonelib.devices.measure.ECGMeasureData;
io.netty.util.internal.logging.Slf4JLoggerFactory;
freemarker.template.TemplateException$PrintStreamStackTraceWriter;
io.netty.util.Version;
freemarker.core.CommandLine;
freemarker.ext.dom.Transform;
io.netty.util.internal.logging.MessageFormatter;
com.konsung.net.EchoClient;
com.konsung.net.EchoClientHandler;
freemarker.template.Template;
freemarker.core.StopException;
freemarker.log.Logger;
com.konsung.util.UiUtils;
io.reactivex.exceptions.CompositeException$WrappedPrintStream;

位置: classes2.dex
org.greenrobot.greendao.generator.ToOne;
org.greenrobot.greendao.generator.DaoGenerator;
org.greenrobot.greendao.generator.ToMany;

警告

检测到2处addFlags使用Intent.FLAG_ACTIVITY_NEW_TASK。

位置: classes.dex
com.facebook.react.modules.intent.IntentModule;->canOpenURL
com.facebook.react.modules.intent.IntentModule;->openURL

APP创建Intent传递数据到其他Activity,如果创建的Activity不是在同一个Task中打开,就很可能被其他的Activity劫持读取到Intent内容,跨Task的Activity通过Intent传递敏感信息是不安全的。建议:
尽量避免使用包含FLAG_ACTIVITY_NEW_TASK标志的Intent来传递敏感信息。

参考资料:
http://wolfeye.baidu.com/blog/intent-data-leak

警告

检测到4个导出的组件接收其他app的消息,这些组件会被其他app引用并导致dos攻击。

activity com.facebook.react.devsupport.DevSettingsActivity
activity com.bqhealth.healthone.activities.ECGWareActivity
activity com.bqhealth.healthone.activities.SPO2WareActivity
service com.konsung.service.AIDLServer

建议:
(1)最小化组件暴露。对不会参与跨应用调用的组件建议显示添加android:exported="false"属性。
(2)设置组件访问权限。对provider设置权限,同时将权限的protectionLevel设置为"signature"或"signatureOrSystem"。
(3)组件传输数据验证。对组件之间,特别是跨应用的组件之间的数据传入与返回做验证和增加异常处理,防止恶意调试数据传入,更要防止敏感数据返回。

参考案例:
http://www.wooyun.org/bugs/wooyun-2010-0169746
http://www.wooyun.org/bugs/wooyun-2010-0104965

参考资料:
http://jaq.alibaba.com/blog.htm?spm=0.0.0.0.Wz4OeC&id=55
《Android安全技术解密与防范》

警告

检测到1个导出的隐式Service组件。
service com.konsung.service.AIDLServer

建议:为了确保应用的安全性,启动Service时,请始终使用显式Intent,且不要为服务声明Intent过滤器。使用隐式Intent启动服务存在安全隐患,因为您无法确定哪些服务将响应Intent,且用户无法看到哪些服务已启动。从Android 5.0(API 级别 21)开始,如果使用隐式 Intent 调用 bindService(),系统会抛出异常。

参考资料:
https://developer.android.com/guide/components/intents-filters.html#Types

警告

检测到3处IvParameterSpec的使用。

位置: classes.dex
com.bqhealth.healthonelib.utils.AESHelper;->AESCipher(I Ljava.lang.String; Ljava.lang.String; Ljava.lang.String;)Z
com.bqhealth.healthonelib.utils.AESHelper;->decrypt(Ljava.lang.String; Ljava.lang.String;)Ljava.lang.String;
com.bqhealth.healthonelib.utils.AESHelper;->encrypt(Ljava.lang.String; Ljava.lang.String;)Ljava.lang.String;

使用IVParameterSpec函数,如果使用了固定的初始化向量,那么密码文本可预测性高得多,容易受到字典攻击等。建议禁止使用常量初始化矢量构造IVParameterSpec,使用聚安全提供的安全组件。

参考资料:
http://drops.wooyun.org/tips/15870
https://developer.android.com/training/articles/keystore.html
http://wolfeye.baidu.com/blog/weak-encryption/
http://www.freebuf.com/articles/terminal/99868.html

警告

检测到1处provider的grantUriPermissions设置为true。
com.imagepicker.FileProvider


grant-uri-permission若设置为true,可被其它程序员通过uri访问到content provider的内容,容易造成信息泄露。

参考资料:
https://security.tencent.com/index.php/blog/msg/6

警告

检测到1处socket通信。

位置: classes.dex
Lfreemarker.debug.impl.DebuggerServer;->startInternal

Android应用通常使用PF_UNIX、PF_INET、PF_NETLINK等不同domain的socket来进行本地IPC或者远程网络通信,这些暴露的socket代表了潜在的本地或远程攻击面,历史上也出现过不少利用socket进行拒绝服务、root提权或者远程命令执行的案例特别是PF_INET类型的网络socket,可以通过网络与Android应用通信,其原本用于linux环境下开放网络服务,由于缺乏对网络调用者身份或者本地调用者id、permission等细粒度的安全检查机制,在实现不当的情况下,可以突破Android的沙箱限制,以被攻击应用的权限执行命令,通常出现比较严重的漏洞

参考案例:
http://www.wooyun.org/bugs/wooyun-2015-0148406
http://www.wooyun.org/bugs/wooyun-2015-0145365

参考资料:
http://wolfeye.baidu.com/blog/open-listen-port
http://blog.csdn.net/jltxgcy/article/details/50686858
https://www.bigniu.com/article/view/10
http://drops.wooyun.org/mobile/6973

警告

检测到7处使用了加解密算法。密钥处理不当可能会导致信息泄露。

位置: classes.dex
okio.Buffer;->hmac(Ljava.lang.String; Lokio.ByteString;)Lokio.ByteString;
okio.ByteString;->hmac(Ljava.lang.String; Lokio.ByteString;)Lokio.ByteString;
com.bqhealth.healthonelib.utils.AESHelper;->AESCipher(I Ljava.lang.String; Ljava.lang.String; Ljava.lang.String;)Z
com.bqhealth.healthonelib.utils.AESHelper;->decrypt(Ljava.lang.String; Ljava.lang.String;)Ljava.lang.String;
com.bqhealth.healthonelib.utils.AESHelper;->encrypt(Ljava.lang.String; Ljava.lang.String;)Ljava.lang.String;
okio.HashingSink;->(Lokio.Sink; Lokio.ByteString; Ljava.lang.String;)V

位置: classes2.dex
okio.HashingSource;->(Lokio.Source; Lokio.ByteString; Ljava.lang.String;)V

参考案例:
http://www.wooyun.org/bugs/wooyun-2010-0105766
http://www.wooyun.org/bugs/wooyun-2015-0162907
http://www.wooyun.org/bugs/wooyun-2010-0187287

参考资料:
http://drops.wooyun.org/tips/15870
https://developer.android.com/training/articles/keystore.html


动态扫描发现风险点

风险等级 风险名称

服务端分析

风险等级 风险名称

警告

检测到?处XSS漏洞。
开发中...

警告

检测到?处XSS跨站漏洞。
开发中...

应用证书