The vulnerability exists in the handling of remote iMessage attachments, which uses SCP and SSH for file transfers. The root cause is twofold. First, the system used an insecure StrictHostKeyChecking=accept-new policy for both SCP (scpFile function) and SSH tunnels (startSshPortForward function). This allows a machine-in-the-middle attacker to intercept the initial connection and have their host key trusted automatically. Second, the remoteHost parameter, which could be set in the configuration or auto-detected from a script, was not validated. This lack of validation, particularly in the monitorIMessageProvider function, allowed a maliciously crafted host string (e.g., containing spaces and extra SSH options) to be passed to the scp command in the scpFile function, leading to an OS command injection vulnerability. The patch addresses these issues by enforcing StrictHostKeyChecking=yes and implementing strict validation and normalization for the remoteHost value.