high · M4 · MASVS-CODE-2 · PTKD-IOS-INSECURE-EXEC
Process execution via system()/exec/popen
The binary imports a process-spawning C function (system/popen/exec*). Spawning a shell is not permitted for App Store iOS apps and is a command-injection sink when reachable with attacker-influenced input.
How it is exploited
The lifted call graph shows the binary imports system()/popen()/exec*. If any attacker-influenced value (a deep-link parameter, a downloaded config, a filename) reaches that call, the attacker runs arbitrary shell commands in the app's context. Even without external input, spawning a shell is grounds for App Store rejection and a strong malware signal.
Why it matters
Arbitrary command execution and full compromise of the app's sandbox when the input is influenced; App Store rejection regardless.
How to fix it
- Remove system()/popen()/exec* entirely; App Store iOS apps have no legitimate reason to spawn a shell or child process.
- Replace the intent with a proper platform API (Foundation for files/networking, a framework for the specific task).
- If a dependency pulled the symbol in, update or replace that dependency.
Does your app have this?
PTKD checks your build or your source project for PTKD-IOS-INSECURE-EXEC and every other check in this knowledge base.
Scan your appReferences
Related checks (M4)
- Supabase function runs any SQL the caller sends
- Deep link URL loaded or opened without a host check (heuristic)
- Hybrid WebView may open any website inside the app
- Wildcard associated domain (universal-link hijack surface)
- Unsafe C string function (buffer overflow risk)
- Hijackable custom URL-scheme deep link
- SQL built by joining request data into a string (text search)
- HTML rendered without sanitizing (dangerouslySetInnerHTML / innerHTML)