The vulnerability is a mass assignment issue within the externalTrigger function in packages/server/src/automations/triggers.ts. When a webhook is triggered, the trigger controller in packages/server/src/api/controllers/webhook.ts passes the entire request body to the externalTrigger function. Inside externalTrigger, the properties of the request body are spread into an object that contains automation parameters. This allows an attacker to overwrite the appId parameter, which is supposed to be controlled by the server.
The modified parameters, including the attacker-controlled appId, are then added to an asynchronous job queue. The automation worker, specifically the doInAutomationContext function in packages/server/src/threads/automation.ts, processes this job. It uses the appId from the job data to set the workspace context for the automation. By providing the appId of a victim's workspace, an attacker can execute their own automations within the context of the victim's workspace, leading to unauthorized data access, modification, and code execution.