Skip to content
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

Block user create with certain characters/strings #2309

Open
peternied opened this issue Dec 7, 2022 · 3 comments
Open

Block user create with certain characters/strings #2309

peternied opened this issue Dec 7, 2022 · 3 comments
Labels
enhancement New feature or request triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.

Comments

@peternied
Copy link
Member

During the user creation flow a user can be created that has the colon character : this user cannot use basic authentication to login - a bad experience. We should safeguard the creation of user to exclude scenarios that are fundamentally invalid.

I would recommend that we try to keep this list as slim as possible to prevent customers from being unable to upgrade from a previous version to a newer version of OpenSearch.

JSON Valid Characters

As OpenSearch communicates via JSON documents, following the JSON definition seems like an easy route to follow as it has minimal restrictions in place. Here are some interesting strings that are allowed.

  • {"🐶🔫": "not nice, but still valid json"}
  • { "*~@#$%^&*()_+=><?/": "is a valid json" }

From https://stackoverflow.com/a/8676132/533057

@shanilpa Could you look into this and provide recommendations if you'd like to see additional restrictions?

@peternied peternied added the bug Something isn't working label Dec 7, 2022
@github-actions github-actions bot added the untriaged Require the attention of the repository maintainers and may need to be prioritized label Dec 7, 2022
@cwperks cwperks added triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable. enhancement New feature or request and removed untriaged Require the attention of the repository maintainers and may need to be prioritized bug Something isn't working labels Dec 12, 2022
@cwperks
Copy link
Member

cwperks commented Dec 12, 2022

[Triage] @shanilpa Would you investigate and report back?

@shanilpa
Copy link

shanilpa commented Dec 14, 2022

Did some digging and this is what I am recommending after synthesizing from a bunch of Google Searches 😅 . If anyone thinks we should expand or reduce this list feel free to leave a comment. As a non developer I'm not sure if some characters might impact code. I've added comments @peternied or someone else please review and we can arrive at a finalized list and some rules.

Acceptable characters for a username can include:

  • Lowercase characters: a-z
  • Uppercase characters: A-Z
  • Numbers: 0-9

Characters that might conflict with code if first but not sure:

  • Exclamation: !
  • Open / Close Parenthesis: ()
  • Open/Close Square bracket: []
  • Dash: -
  • Underscore: _
  • Period: .
  • Question mark: ?
  • Number Sign: #
  • Dollar Sign: $
  • Plus sign: +
  • Equals sign: =

Additional characters to support accents in names not sure if these are all ASCII?:

  • Grave accent: ` (eg. è)
  • Tilde: ~ (eg. ñ)
  • Acute accent: á
  • Circumflex accent: â
  • Diaeresis, or trema, or umlaut: ü
  • Cedilla: ç
  • Ring, or bolle: å
  • slash, or solidus, or virgule: ø

Rules

  • Can't use a space in a user name: eg. user name
  • Can't use the same special character more than once consecutively. eg. user...name
  • Can't use Non-ASCII characters

@davidlago
Copy link

[Triaging] Capturing what we discussed in our triaging meeting: we need to be careful, as restricting usernames is a breaking change we'll need to navigate (what happens with users created prior to this rule that now break it?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.
Projects
None yet
Development

No branches or pull requests

4 participants