我已经为我的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 那么我能删除这段代码吗?它会影响我的项目吗?
提前谢谢。
发布于 2021-01-31 22:31:51
考虑到Xcode 7已经超过五年了,并且至少需要Xcode 11才能提交应用程序商店,删除该代码似乎是安全的。
但是,考虑到不应该运行脚本代码,二进制文件中的@rpath可能来自其他方面。
https://stackoverflow.com/questions/65975952
复制相似问题