Skip to content

Only prevent user creation on colon characters, separate out tests#1

Merged
rutuja-amazon merged 1 commit intorutuja-amazon:username-validationfrom
peternied:username-validation
Dec 9, 2022
Merged

Only prevent user creation on colon characters, separate out tests#1
rutuja-amazon merged 1 commit intorutuja-amazon:username-validationfrom
peternied:username-validation

Conversation

@peternied
Copy link
Copy Markdown

Description

Only prevent user creation on colon characters, separate out tests

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Peter Nied <petern@amazon.com>

public class InternalUsersApiAction extends PatchableResourceApiAction {
static final List<String> RESTRICTED_FROM_USERNAME = ImmutableList.of(
":" // Not allowed in basic auth, see https://stackoverflow.com/a/33391003/533057
Copy link
Copy Markdown

@shikharj05 shikharj05 Dec 6, 2022

Choose a reason for hiding this comment

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

While restricting to : is good, we should allowlist known safe characters that can be used. Performing stricter input validation will help improve security posture against known injection, path traversal, etc. attacks.

@rutuja-amazon rutuja-amazon merged commit cdb5e11 into rutuja-amazon:username-validation Dec 9, 2022
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.

3 participants