gpt4 book ai didi

swift - 从安全分析中获取警告 "Remove the compiler option -rpath to remove @rpath"

转载 作者:行者123 更新时间:2023-12-05 04:53:37 29 4
gpt4 key购买 nike

我已经对我的 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 已有五年多的历史,并且应用商店提交至少需要 Xcode 11,删除该代码似乎是安全的。

但是,鉴于不应运行脚本代码,二进制文件中的 @rpath 可能来自其他内容。

关于swift - 从安全分析中获取警告 "Remove the compiler option -rpath to remove @rpath",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65975952/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com