Repository navigation
Conversation
The feedback server action keyed its limit on the caller-chosen page URL, so varying a query string reset the limit and allowed unlimited GitHub Discussions and Discord posts. Limit by client IP with a global cap, backed by Upstash when configured, accept only existing docs pages with the query stripped, and neutralize @mentions in GitHub and Discord posts.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The docs feedback server action rate limited by the submitted page URL, which the caller controls. Any new string such as
/docs?a=1,/docs?a=2got a fresh bucket, so an anonymous script could create unlimited GitHub Discussions and Discord posts, including@mentionsthat notify GitHub users.Submissions are now limited per client IP (
cf-connecting-ip, then Vercel'sx-real-ip/x-forwarded-for) at 3 per minute, plus a global cap of 20 per minute. Both use Upstash when configured, so the limit holds across serverless instances, and fall back to in-memory otherwise. The URL must resolve to an existing docs page indocsSource, with query string and fragment stripped and the locale prefix kept.@in messages is broken with a zero-width space for GitHub, and the Discord webhook sendsallowed_mentions: { parse: [] }.Change Type
Testing
vitest runon the feedback, chat and subscribe tests: 26 passed. New cases cover 10 submissions with different?x=suffixes from one client (only 3 succeed), rejection of non-existent pages, query stripping with locale kept,allowed_mentions, and mention escaping.tscreports no errors in them.Checklist