Skip to content

Commit 9d93a16

Browse files
committed
Limit input query size to agents to 5000 characters. This is already a huge limit but previously it was unbounded which was an issue in the pentest
1 parent 5f30f95 commit 9d93a16

File tree

1 file changed

+8
-0
lines changed
  • src/lambda/agent_request_handler

1 file changed

+8
-0
lines changed

src/lambda/agent_request_handler/index.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ def handler(event, context):
8181
"body": error_msg
8282
}
8383

84+
if len(query) > 5000:
85+
error_msg = "Query exceeds maximum length of 5000 characters"
86+
logger.error(f"{error_msg}. Query length: {len(query)}")
87+
return {
88+
"statusCode": 400,
89+
"body": error_msg
90+
}
91+
8492
if not agent_ids:
8593
error_msg = "At least one agent ID is required"
8694
logger.error(error_msg)

0 commit comments

Comments
 (0)