Skip to content

Commit 7fbc936

Browse files
jonwalstedtclaude
andcommitted
fix(security): add max length constraint to alertIds string schema
Addresses CodeQL unbounded-string alert: adds .max(512) to the z.string() inside the alertIds array schema (ES _id values are at most 512 bytes). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ebbbbae commit 7fbc936

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • x-pack/solutions/security/plugins/security_solution/server/agent_builder/attachments

x-pack/solutions/security/plugins/security_solution/server/agent_builder/attachments/alerts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { getAlertsById } from '../tools/get_alerts_by_id';
2222
import { securityAttachmentDataSchema } from './security_attachment_data_schema';
2323

2424
export const bulkAlertsAttachmentDataSchema = securityAttachmentDataSchema.extend({
25-
alertIds: z.array(z.string()).min(1).max(ALERTS_BATCH_MAX_SIZE),
25+
alertIds: z.array(z.string().max(512)).min(1).max(ALERTS_BATCH_MAX_SIZE),
2626
});
2727

2828
export type BulkAlertsAttachmentData = z.infer<typeof bulkAlertsAttachmentDataSchema>;

0 commit comments

Comments
 (0)