The vulnerability is an authorization bypass that allows unauthenticated users to modify webhook and automation schemas. The root cause is in the isWebhookEndpoint function within packages/server/src/middleware/utils.ts. This function uses a regular expression to identify public webhook endpoints that do not require authentication. The regex ^/api/webhooks/(trigger|schema|discord|ms-teams|slack)(/|$) incorrectly includes /api/webhooks/schema, which is a sensitive endpoint intended only for authenticated builders.
The authorization middleware, located in packages/server/src/middleware/authorized.ts, relies on the isWebhookEndpoint function. When a request is made to /api/webhooks/schema, the middleware incorrectly identifies it as a public endpoint and skips authentication, passing the request to the next handler.
This allows the unauthenticated request to reach the buildSchema controller function in packages/server/src/api/controllers/webhook.ts. This function processes the request body and overwrites the bodySchema of the specified webhook, and can also modify the trigger schema of any associated automation. An attacker with knowledge of a valid webhook ID can therefore corrupt webhook and automation configurations, leading to disruption of service.