RocketChat / RocketChat/Rocket.Chat

Invalid “UTF8 Names Validation” regexp breaks channels

Open
#8,849 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feat: app settings type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:
Server Setup Information:
  • Version of Rocket.Chat Server: 0.59.3
  • Operating System: Linux
  • Deployment Method(snap/docker/tar/etc): Rocket Chat Cloud
  • Number of Running Instances: ?
  • DB Replicaset Oplog: ?
  • Node Version: v4.8.4
Steps to Reproduce:
  1. Go to administrative UI » General » UTF8
  2. Enter an invalid regular expression, such as: /([0-9a-zæøåA-ZÆØÅ-_.]+)/
  3. Save.
  4. Reload normal UI.
  5. Click a channel.
Expected behavior:

One of two options:

  1. The UI works as normal, but now allows channel names containing the Danish special characters Æ, Ø and Å.
  2. Otherwise, I get an error when attempting to save the setting due to its invalid value.
Actual behavior:

The setting is saved, and I get the following JavaScript error when rendering channels:

SyntaxError: Invalid regular expression: /@([0-9a-zæøåA-ZÆØÅ-_.]+)/: Range out of order in character class

The error breaks channel rendering completely.

Relevant logs:

I no longer have any relevant logs, sorry.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the administrative UI's General » UTF8 setting and trace how the saved regular expression is consumed when rendering channels. Reproduce with /([0-9a-zæøåA-ZÆØÅ-_.]+)/ and verify that an invalid expression is rejected on save or that valid Danish characters work without breaking channel rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.