greet
greet
  • 发布:2024-08-21 12:01
  • 更新:2024-08-21 17:27
  • 阅读:72

StrandHogg高危漏洞修复问题

分类:uni-app

问题描述

检测到AndroidManifest.xml文件中没有设置taskAffinity属性为空字符串,说明该应用存在StrandHogg漏洞。

0,文件:AndroidManifest.xml
代码:<activity android:configChanges=keyboardHidden|orientation android:exported=false android:name=io.dcloud.feature.nativeObj.photoview.PhotoActivity android:noHistory=false android:screenOrientation=behind android:theme=@style/DeviceDefault.Light/>

1,文件:AndroidManifest.xml
代码:<activity android:configChanges=fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize android:hardwareAccelerated=true android:icon=@drawable/dcloud_recent android:label=@string/stream_my android:launchMode=singleTask android:name=io.dcloud.WebAppActivity android:screenOrientation=portrait android:theme=@style/DCloudTheme android:windowSoftInputMode=adjustResize/>

2,文件:AndroidManifest.xml
代码:<activity android:excludeFromRecents=true android:exported=false android:name=io.dcloud.ProcessMediator android:theme=@android:style/Theme.Translucent.NoTitleBar/>

解决方案

修复流程 点击这里可以查看官方文档

Strandhogg漏洞
风险描述 StrandHogg之所以独特,是因为它无需进行植根即可启用复杂的攻击,它利用Android的多任务系统中的一个弱点来实施强大的攻击,使恶意应用程序可以伪装成该设备上的任何其他应用程序。此漏洞利用基于一个称为“ taskAffinity”的Android控件设置,该控件允许任何应用程序(包括恶意应用程序)自由地采用其所需的多任务处理系统中的任何身份。

修复方案 该漏洞已于2020.4.1的安全补丁中修复(涵盖Android 8.0 / 8.1 / 9.0+)。由于已经通过系统补丁封堵。理论上该漏洞不会对高版本系统的手机设备构成威胁。 而app客户端开发并没有彻底规避该漏洞的方案。各检测平台推荐配置android:taskAffinity=“”,但仅是临时方案。但该方案会导致应用运行到android11+系统设备时任务堆栈窗口变成两个的问题。 由于android:taskAffinity=“”配置存在bug!所以我们并不会默认这样配置。但为开发者提供的云打包配置选项。由开发者决定是否配置临时封堵该漏洞。具体如下:

请使用HX3.3.10+版本。根据app类型在项目的manifest.json中配置hasTaskAffinity。true表示配置android:taskAffinity=“”,false不配置。默认为false
uni-app 请按如下配置填写到项目的manifest.json中。

"app-plus" : {  
     "distribute" : {  
         "android" : {  
             ...  
             ...  
             "hasTaskAffinity": true  
         }  
     }  
 }

解决过程

实际配置信息可查看附件,配置完成打包后生成apk文件进行加固重签名之后,进行安全检测依然存在该问题。

通过问题对比查看 AndroidManifest.xml 配置文件,发现配置中 android:name="io.dcloud.PandoraEntry",android:name="io.dcloud.PandoraEntryActivity"配置了android:taskAffinity="",其他android:name="io.dcloud.feature.nativeObj.photoview.PhotoActivity"android:name="io.dcloud.WebAppActivity",·android:name="io.dcloud.ProcessMediator"·,等都未配置android:taskAffinity=""的情况

<activity  
            android:theme="@7F0E00A5"  
            android:label="@7F0D001B"  
            android:name="io.dcloud.PandoraEntry"  
            android:exported="true"  
            android:taskAffinity=""   // 此处配置了  
            android:screenOrientation="2"  
            android:configChanges="0x40000DF3"  
            android:windowSoftInputMode="0x00000010"  
            android:hardwareAccelerated="true"  
            >  
        </activity>  
        <activity  
            android:theme="@7F0E00A3"  
            android:label="@7F0D001B"  
            android:name="io.dcloud.PandoraEntryActivity"  
            android:exported="false"  
            android:taskAffinity=""  // 此处配置了  
            android:launchMode="2"  
            android:screenOrientation="1"  
            android:configChanges="0x40000FF3"  
            android:windowSoftInputMode="0x00000010"  
            android:hardwareAccelerated="true"  
            >  
        </activity>  
          // 以下配置项中均未配置  android:taskAffinity=""  
        <activity  
            android:theme="@7F0E00A7"  
            android:name="io.dcloud.feature.nativeObj.photoview.PhotoActivity"  
            android:exported="false"  
            android:screenOrientation="3"  
            android:configChanges="0x000000A0"  
            android:noHistory="false"  
            >  
        </activity>  
        <activity  
            android:theme="@7F0E00A4"  
            android:label="@7F0D0148"  
            android:icon="@7F0600B5"  
            android:name="io.dcloud.WebAppActivity"  
            android:launchMode="2"  
            android:screenOrientation="1"  
            android:configChanges="0x40000DF3"  
            android:windowSoftInputMode="0x00000010"  
            android:hardwareAccelerated="true"  
            >  
        </activity>  
        <activity  
            android:theme="@android:01030010"  
            android:name="io.dcloud.ProcessMediator"  
            android:exported="false"  
            android:excludeFromRecents="true"  
            >  
        </activity>  
              ...

望各位大佬帮帮忙,能否解决下,不胜感激!!!

2024-08-21 12:01 负责人:无 分享
已邀请:
白鹭残暑

白鹭残暑 - ^ ^

实在没办法试试离线打包吧,手动配置mainfest

要回复问题请先登录注册