Skip to content

[fix] Add search query validation and length limit (#2833)#6507

Open
xiaofengzii wants to merge 1 commit into
SecureBananaLabs:mainfrom
xiaofengzii:agent/fix-search-validation-2833
Open

[fix] Add search query validation and length limit (#2833)#6507
xiaofengzii wants to merge 1 commit into
SecureBananaLabs:mainfrom
xiaofengzii:agent/fix-search-validation-2833

Conversation

@xiaofengzii

Copy link
Copy Markdown

Summary

This PR adds input validation and length limits to the GET /api/search endpoint.

Changes

  • Validate query is a string
  • Trim whitespace from query
  • Reject queries longer than 200 characters
  • Add comprehensive tests

Verification

)

- Validate query is a string
- Trim whitespace from query
- Reject queries longer than 200 characters
- Add comprehensive tests
- Fixes SecureBananaLabs#2833

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search endpoint has no input validation or length limit on query

1 participant