Skip to content

Fixed an issue where control characters were allowed in usernames#5835

Merged
mitchelsellers merged 4 commits intodnnsoftware:developfrom
GerardSmit:issue-5834
Oct 10, 2023
Merged

Fixed an issue where control characters were allowed in usernames#5835
mitchelsellers merged 4 commits intodnnsoftware:developfrom
GerardSmit:issue-5834

Conversation

@GerardSmit
Copy link
Copy Markdown
Contributor

Fixes #5834

Summary

Prevents control characters to be inserted in the username field.

Before (http://localhost/Login?username=User%00name):
image

After (http://localhost/Login?username=User%00name):
image

Noteworthy, this blocks all control characters, including \n or \r. Instead of removing \t I've added a replacement of a space, but I don't think anyone uses a tab (since this switches the input field in the browser) or new lines (since this isn't a textarea) in their username.

Copy link
Copy Markdown
Contributor

@bdukes bdukes left a comment

Choose a reason for hiding this comment

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

Thanks!

@bdukes bdukes added this to the 9.13.1 milestone Oct 9, 2023
@GerardSmit GerardSmit requested a review from bdukes October 9, 2023 19:06
Copy link
Copy Markdown
Contributor

@bdukes bdukes left a comment

Choose a reason for hiding this comment

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

👍🏻

@mitchelsellers mitchelsellers merged commit 746470b into dnnsoftware:develop Oct 10, 2023
@GerardSmit GerardSmit deleted the issue-5834 branch October 10, 2023 19:20
@valadas valadas changed the title Prevent control characters in username Fixed an issue where control characters were allowed in usernames Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Login module allows control characters

3 participants