We tested one of our iOS app with MobSF and the report highlighted that 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.
I ran otool -L
against the binary to check which dependencies are concerned. It turns out that all pods (Cocaopod) and and some system libraries are concerned.
name @rpath/Alamofire.framework/Alamofire (offset 24)
name @rpath/libswiftCoreAudio.dylib (offset 24)
name @rpath/libswiftCoreData.dylib (offset 24)
name @rpath/libswiftCoreFoundation.dylib (offset 24)
I wonder how to fix this issue. Cocoapods prints a warning if the project build setting Runpath Search Paths
does not include $(inherited).
Is using @rpath considered harmful? Any help/information appreciated.