Skip to content

Don't allow tagnames longer than 255 bytes #18660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 18, 2025

Conversation

SnackEngineer
Copy link
Contributor

@SnackEngineer SnackEngineer commented Jul 4, 2025

If a user tries to add a tag with a length of over 255 bytes return BAD_REQUEST, since this is not allowed by the matrix specification.
(see: https://spec.matrix.org/v1.15/client-server-api/#events-14)

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@SnackEngineer SnackEngineer requested a review from a team as a code owner July 4, 2025 13:35
Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! A small gotcha and nit below, but otherwise LGTM!

If a user tries to add a tag with a length of over 255 bytes
return BAD_REQUEST, since this is not allowed by the matrix
specification.
(see: https://spec.matrix.org/v1.15/client-server-api/#events-14)
Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@anoadragon453 anoadragon453 enabled auto-merge (squash) July 18, 2025 12:53
@anoadragon453 anoadragon453 disabled auto-merge July 18, 2025 13:23
@anoadragon453 anoadragon453 merged commit 6127aa0 into element-hq:develop Jul 18, 2025
37 of 39 checks passed
@anoadragon453
Copy link
Member

(CI failures are unrelated to this PR.)

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.

2 participants