o***@sina.cn
o***@sina.cn
  • 发布:2025-03-20 13:57
  • 更新:2025-03-24 14:48
  • 阅读:58

app安全漏洞检测

分类:uni-app

uniapp项目,打包ios应用,但是安全检测存在下面漏洞,需要如何修复

2025-03-20 13:57 负责人:无 分享
已邀请:
DCloud_App_Array

DCloud_App_Array

这是什么检测机构出的报告,发出完整的文档看下。
ios是发布到App Store分发的,正常情况下并不存在二次签名打包的风险。

  • o***@sina.cn (作者)

    有3个app进行了检测, 其他两个是原生开发的, 同样的规则下面没有检测出来此漏洞, uniapp开发的这个里面检测不来了,想问下有没有解决方案

    2025-03-24 14:58

o***@sina.cn

o***@sina.cn (作者)

开发者自查:

1)增加程序检测防止二次签名,定义变量保存embedded.mobileprovisivision中hash值,在应用启动后比较bundleIDPrefix返回值与hash是否相同,示例代码如下:
-(NSString )bundleIDPrefix
{
static NSString
buPreStr=nil;
if (buPreStr.length==0) {
@try
{
NSDictionary query = [NSDictionary dictionaryWithObjectsAndKeys: (id)kSecClassGenericPassword, kSecClass, @"bundleIDPrefix", kSecAttrAccount, @"", kSecAttrService, (id)kCFBooleanTrue, kSecReturnAttributes, nil];
CFDictionaryRef result = nil;
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef
)&result);
if (status == errSecItemNotFound)
status = SecItemAdd((bridge CFDictionaryRef)query, (CFTypeRef )&result);
if (status != errSecSuccess)
return nil;
NSString
accessGroup = [(
bridge NSDictionary )result objectForKey:(id)kSecAttrAccessGroup];
NSLog(@"accessGroup:%@",accessGroup);
NSArray
components = [accessGroup componentsSeparatedByString:@"."];
buPreStr = [[components objectEnumerator] nextObject];
CFRelease(result);
}
@catch(NSException *ex)
{
}
}
return buPreStr;
}

2)方法(1)在上线后,经过app Store处理,会存在无法获取bundleID的情况,建议配合iOS加固,以便更准确的获取bundleID,避免应用被篡改及二次打包的风险

这是报告中提供的解决方案

要回复问题请先登录注册