我们正在使用 Fortify 扫描我的 Android 源代码,但我无法摆脱这个问题:
类别:Android 不良做法:缺少 Google Play 服务更新的安全提供程序(1 期)
Fortify指向这行代码:
工具:替换=“android:allowBackup”>
AndroidManifest.xml:37 null()
<application
android:name=".test"
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:allowBackup"> <!--FORTIFY POINTS TO THIS LINE-->
强化推荐:
修补安全提供程序的最简单方法是调用
同步方法 installIfNeeded()。这是适当的,如果用户
等待时不会因为线程阻塞而影响体验
要完成的操作,否则应该在
异步方式。
有关此的更多信息issue https://vulncat.fortify.com/en/detail?id=desc.configuration.java.android_bad_practices_missing_google_play_services_updated_security_provider
我关注的是安卓的更新您的安全提供商以防止 SSL 漏洞 https://developer.android.com/training/articles/security-gms-provider
并尝试了两种方法:
安装如果需要() and installIfNeededAsync()
但问题仍然存在。我测试了我的代码,它工作正常。
这是我的清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="test">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".test"
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:allowBackup">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<provider
android:name=".syncadapter.StubProvider"
android:authorities="com.neseapl.nyp.provider"
android:exported="false"
android:syncable="true"/>
<service
android:name=".syncadapter.SyncService"
android:exported="false">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
</service>
<service
android:name=".syncadapter.AuthenticatorService">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator"/>
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/account_authenticator" />
</service>
<activity
android:name=".activities.Test"
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我的清单中缺少任何内容吗?谢谢!
我最近在使用 Fortify 时遇到了类似的问题。正如 Silvia Ragui 指出的那样,Fortify 没有正确分析这个运行时进程。虽然 installIfNeeded() 和 installIfNeededAsync() 将更新 APK 实际部署中的安全提供程序,但当您重新提交到 Fortify 时,它似乎不会清除错误。
然而,根本问题是过时的安全提供程序,这通常是由于您的包中的游戏服务库过时造成的。
以下是直接来自 fortify 仪表板的建议:
Android 依靠安全提供程序来提供安全的网络通信。默认设备加密库通常是旧版本的 OpenSSL,其中包含已知缺陷。为了克服这个问题,Google 提供了一种机制,让应用程序可以通过 Google Play Services ProviderInstaller 客户端“修补”其本地 OpenSSL 副本。已确定该应用程序未使用更新的提供程序,从而使该应用程序暴露于较旧的已知 OpenSSL 漏洞和弱点。>
实际问题与 Silvia 日志中的最后一行相同:
W/GooglePlayServicesUtil Google Play 服务已过时
在我们的例子中,我们更新到了包中的 Play Services 的最新版本,并实施the fix https://developer.android.com/training/articles/security-gms-provider上面(当我们这样做时,我们发现有一个必须修复的小错误,并且可能阻止更新修补安全提供程序)
新版本成功解决了该问题。我建议您更新到最新的 Play 服务,因为这也会更新安全提供商。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)