Skip to content

fix: cap invite_user list at 5 - #1636

Merged
LinkinStars merged 2 commits into
apache:devfrom
TastyHeadphones:fix/cap-invite-user-list
Nov 24, 2026
Merged

LinkinStars merged 2 commits into
apache:devfrom
TastyHeadphones:fix/cap-invite-user-list

Conversation

@TastyHeadphones

@TastyHeadphones TastyHeadphones commented Sep 27, 2026 •

Copy link
Copy Markdown

PUT /answer/api/v1/question/invite took an uncapped invite_user array, so one request could trigger a huge notification fan-out. ASF security called that out as hardening rather than a boundary issue.

Added max=5 on the request structs (validator) and the same limit in the invite UI when picking people.

Fixes #1617

The invite endpoint accepted an uncapped invite_user array, so one
request could fan out a huge number of notifications. Match a 20-user
server/UI limit.
@LinkinStars

Copy link
Copy Markdown
Member

@fenbox Could you please confirm whether we need a product-level limit on the number of users that can be invited to answer a question? This PR uses 20 as the limit to bound notification fan-out. If a limit is needed, is 20 the expected value?

@fenbox

fenbox commented Nov 19, 2026

Copy link
Copy Markdown
Member

@LinkinStars @TastyHeadphones Yes, adding a limit makes sense. Let's set it to 5 users instead of 20. That's usually enough for targeted Q&A without causing notification fatigue. Please update both the backend validator and UI limit to 5. Thanks!

Per maintainer feedback on the PR, cap invites at 5 users in both the
request validator and the invite UI.
@TastyHeadphones TastyHeadphones changed the title fix: cap invite_user list at 20 fix: cap invite_user list at 5 Nov 23, 2026
@TastyHeadphones

Copy link
Copy Markdown
Author

Thanks @fenbox. Pushed ec5df27: lowered the cap to 5 in both the backend validator (max=5 on invite_user) and the invite UI (MAX_INVITE_USERS = 5).

@LinkinStars
LinkinStars changed the base branch from main to dev November 24, 2026 09:35
@LinkinStars

Copy link
Copy Markdown
Member

Thanks for the fix!

@LinkinStars
LinkinStars merged commit bf6810c into apache:dev Nov 24, 2026
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.

Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-out

3 participants