subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def activate_app(app_name): """Bring an app to the foreground.""" subprocess.run( ["osascript", "-e", f'tell application "{app_name}" to activate'], capture_output=True, timeout=5,- Confidence
- 98% confidence
- Finding
- This call builds AppleScript code by directly interpolating the untrusted app_name into a quoted script string. An attacker who can influence the app name argument can break out of the string and inject arbitrary AppleScript commands, which may control apps, read data, or trigger further system actions under the user's automation permissions.
