Security Fix for Business Logic Errors - huntr.dev #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://huntr.dev/users/d3v53c has fixed the Business Logic Errors vulnerability 🔨. Think you could fix a vulnerability like this?
Get involved at https://huntr.dev/
Q | A
Version Affected | ALL
Bug Fix | YES
Original Pull Request | 418sec#1
Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/other/node-login/2/README.md
User Comments:
📊 Metadata *
node-login is a template for quickly building login systems on top of Node.js & MongoDB. The business logic which updates account details fails to verify if the provied email is associated with another account.
Bounty URL: https://www.huntr.dev/bounties/2-other-node-login
⚙️ Description *
Whenever account details are updated, the email is validated against existing users, to avoid identical email accounts.
💻 Technical Description *
When an update request is initialized,
email
attribute in request body is used to run a query to determine, whether an account exists with the same email address. If there exists, and it's not the same user, then request is rejected and appropriate error message is shown in the browser.🐛 Proof of Concept (PoC) *
Navigate to /signup and Create two accounts with data like below
Account 1 - username: victim, email: [email protected]
Account 2 - username: hacker, email: [email protected]
Account creation functionality does not allows to create user with existing email. poc1
Login to the hacker account
In the account update section, change the email field with victim email and submit the form. poc2
Now both accounts are associated with victim's email.
Check MongoDB backend for confirmation poc2
🔥 Proof of Fix (PoF) *
👍 User Acceptance Testing (UAT)
After fix, functionality is unaffected.