Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion workflow/packages/backend/api/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,18 @@ export const setupApp = async (app: FastifyInstance): Promise<FastifyInstance> =

await app.register(fastifySocketIO, {
cors: {
origin: '*',
// SECURITY FIX: Restrict WebSocket connections to trusted domains only
origin: [
'https://app.aixblock.io',
'https://workflow.aixblock.io',
'https://localhost:3000', // Development environment
'http://localhost:3000', // Development environment
'https://127.0.0.1:3000', // Local development
'http://127.0.0.1:3000' // Local development
],
credentials: true,
methods: ['GET', 'POST'],
allowedHeaders: ['Authorization', 'Content-Type']
},
...spreadIfDefined('adapter', await getAdapter()),
transports: ['websocket'],
Expand Down