Skip to content

fix(search): remove quadratic backtracking from query param parsing - #132255

Draft
JoshuaKGoldberg wants to merge 1 commit into
masterfrom
joshgoldberg/exp-1473-security-report-sentry-searchdiscover
Draft

JoshuaKGoldberg wants to merge 1 commit into
masterfrom
joshgoldberg/exp-1473-security-report-sentry-searchdiscover

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Some search and Discover query checks got much slower on long, specially crafted input. This rewrites them so they stay fast at any length and still accept the same queries, except one misuse of quotes that used to slip through.

Closes EXP-1473.

Rewrite the alias and apdex/user_misery regexes so they can't backtrack quadratically on crafted input, and stop re-slicing search values once per escaped quote. Accepted inputs are unchanged, except unescaped quotes that follow an escaped quote are now correctly rejected.

Fixes EXP-1473
@linear-code

linear-code Bot commented Nov 23, 2026

Copy link
Copy Markdown

EXP-1473

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 23, 2026
@JoshuaKGoldberg JoshuaKGoldberg changed the title fix(search): Remove quadratic backtracking from query param parsing fix(search): remove quadratic backtracking from query param parsing Nov 23, 2026
@JoshuaKGoldberg

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 761fd8f. Configure here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant