Skip to content

Commit dc7814b

Browse files
waleedlatif1claude
andcommitted
fix(monday): sanitize columns JSON in search_items GraphQL query
Parse and re-stringify the columns param to ensure well-formed JSON before interpolating into the GraphQL query, preventing injection via malformed input. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 580164c commit dc7814b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/sim/tools/monday/search_items.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export const mondaySearchItemsTool: ToolConfig<MondaySearchItemsParams, MondaySe
6060
}
6161
}
6262
const columnsJson =
63-
typeof params.columns === 'string' ? params.columns : JSON.stringify(params.columns)
63+
typeof params.columns === 'string'
64+
? JSON.stringify(JSON.parse(params.columns))
65+
: JSON.stringify(params.columns)
6466
return {
6567
query: `query { items_page_by_column_values(limit: ${limit}, board_id: ${params.boardId}, columns: ${columnsJson}) { cursor items { id name state board { id } group { id title } column_values { id text value type } created_at updated_at url } } }`,
6668
}

0 commit comments

Comments
 (0)