swift - 从安全分析中获得警告“删除编译器选项 -rpath 以删除 @rpath”
问题描述
我已经为我的 IOS 应用程序进行了质量扫描分析。我收到以下警告:
The binary has Runpath Search Path (@rpath) set. In certain cases an attacker can abuse this feature to run arbitrary executable for code execution and privilege escalation. Remove the compiler option -rpath to remove @rpath.
我在我发现的代码和下面的代码中搜索@rpath
并找到了:pod-framework.sh
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
那么我可以删除此代码吗?会影响我的项目吗?
提前致谢。
解决方案
鉴于 Xcode 7 已经超过 5 年了,并且应用商店提交至少需要 Xcode 11,删除该代码似乎是安全的。
但是,鉴于不应运行脚本代码,@rpath
二进制文件中的 可能来自其他东西。
推荐阅读
- html - Bootstrap 在列中间有图标
- r - 清除多个selectizeInput时如何在闪亮中触发observeEvent
- heidisql - 如何禁用 HeidiSQL 尝试对“数据”选项卡进行排序
- sharepoint - 向共享点询问列表中的项目时出现 UnauthorizedAccessException
- excel - Excel VBA比较,添加行并填写
- javascript - 检查函数是否是类的方法?
- azure - 如何在 Azure Spark 群集中使用 pyspark 覆盖文件
- ios - 如何在 BOX Content SDK for iOS 中实现 BOXContentCacheClientProtocol
- google-apps-script - Google 脚本用户对此配置文件没有足够的权限。谷歌分析
- javascript - 无法访问函数内部的状态