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

Unexpected authorized access in security jwt with wrong username but correct password #164

Closed
A-5ingh opened this issue Sep 1, 2020 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@A-5ingh
Copy link

A-5ingh commented Sep 1, 2020

Describe the bug
After generating default Monolithic application using nhipster with frontend as either angular or react. We can login into application by using credentials without entering any username:

  1. Username - (any string or blank), password - admin
  2. Username - (any string or blank), password - user

To Reproduce
Steps to reproduce the behavior:

  1. Generate monolithic application using any frontend, install dependencies and run the application.
  2. Go to Account menu
  3. Click on Sign In
  4. Enter invalid username but correct password
  5. User gets logged in

Expected behavior
User should not be able to login into the application with invalid username and correct password.

Screenshots
MainPage
SuccessfullLogin

Desktop (please complete the following information):

  • OS: Windows Server 2012 R2
  • Browser: Chrome
  • Version: 84.0.4147.135

Additional context
Same issue can be seen in swagger api, we can authenticate user by providing incorrect username and correct password.

@ghost
Copy link

ghost commented Sep 1, 2020

Hi @A-5ingh , thanks for the interest!
Then you are saying that you can login with a incorrect username but correct password?
I will check it, thanks.

@ghost ghost self-assigned this Sep 1, 2020
@ghost ghost changed the title Unauthorized Access to application and API when using JWT method Unexpected authorized access in security jwt with wrong username but correct password Sep 1, 2020
@ghost ghost added the bug Something isn't working label Sep 1, 2020
@ghost ghost added this to the 1.2.0 milestone Sep 1, 2020
@ghost ghost closed this as completed in 9a4ddfb Sep 1, 2020
@ghost ghost reopened this Sep 1, 2020
@ghost
Copy link

ghost commented Sep 1, 2020

Thanks! I have found the bug and fixed that. You are welcome!

@ghost ghost closed this as completed Sep 1, 2020
@A-5ingh
Copy link
Author

A-5ingh commented Sep 1, 2020

Thanks! I have found the bug and fixed that. You are welcome!

Thank you for the quick fix. Yes, I was able to login with any string as username (even empty, that will be another client validation failure bug). Only the password had to be correct (means of any account like admin/user etc).

May I also know what exactly was wrong with the JWT code ? @amanganiello90 No worries, I found the commit.

@ghost
Copy link

ghost commented Sep 1, 2020

Yeah @A-5ingh , it's very simple, the commit has the issue number as message, and this issue has a comment for that 👍

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant