subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
script = f'display notification "{message}" with title "{title}" sound name "default"' try: subprocess.run( ["osascript", "-e", script], check=True, capture_output=True- Confidence
- 96% confidence
- Finding
- The macOS notification path builds an AppleScript command by interpolating untrusted request-derived text into a script string and then passes it to osascript. Although subprocess is invoked without shell=True, the dangerous interpreter is AppleScript itself, so crafted quotes or script fragments in request.operation or request.resource_path could break out of the notification string and execute unintended AppleScript commands.
