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

Password reset GraphQl endpoint can be used for User enumeration #37886

Open
1 of 5 tasks
Hexmage opened this issue Aug 17, 2023 · 8 comments
Open
1 of 5 tasks

Password reset GraphQl endpoint can be used for User enumeration #37886

Hexmage opened this issue Aug 17, 2023 · 8 comments
Assignees
Labels
feature request Progress: dev in progress Project: GraphQL Reported on 2.4.2 Indicates original Magento version for the Issue report.

Comments

@Hexmage
Copy link

Hexmage commented Aug 17, 2023

Preconditions and environment

  • 2.4.2+ most likely present in earlier versions as well.

Steps to reproduce

  1. Create a password request graphql query for an existing account
    "mutation requestPasswordResetEmail() { requestPasswordResetEmail(email: 'existing@example.org')}
  2. Create a password request graphql query for a non-existing account
    "mutation requestPasswordResetEmail() { requestPasswordResetEmail(email: 'nonexisting@example.org')}

Expected result

Both return a successful password reset message
{"data":{"requestPasswordResetEmail":true}}

Actual result

The existing one returns:
{"data":{"requestPasswordResetEmail":true}}
The non existing one returns:
{ "errors": [ { "message": "Cannot reset the customer's password", "extensions": { "category": "graphql-input" }, "locations": [ { "line": 2, "column": 3 } ], "path": [ "requestPasswordResetEmail" ], "code": 502 } ], "data": { "requestPasswordResetEmail": null } }

This means that the reset password graphql endpoint can be used to identify if accounts exist or not. Which is potentially harmful to the account owner.

Additional information

Preferably both calls should take the same amount of time to send a response. As more advanced bots will use the difference in response time to determine if an account exists or not.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Aug 17, 2023

Hi @Hexmage. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@m2-assistant
Copy link

m2-assistant bot commented Aug 17, 2023

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added Reported on 2.4.2 Indicates original Magento version for the Issue report. Project: GraphQL labels Aug 17, 2023
@engcom-Bravo
Copy link
Contributor

Hi @Hexmage,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance.Kindly refer the screenshots.

for EXISTING ACCOUNT

Screenshot 2023-08-18 at 12 30 07 PM

for NON-EXISTING ACCOUNT

Screenshot 2023-08-18 at 12 34 58 PM Screenshot 2023-08-18 at 12 41 12 PM

It looks like expected behaviour of Magneto for non existing account it is returning Cannot reset the customer's password because the customer is not there in the records with that email address.

could you please let us know if we are missing anything.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Aug 18, 2023
@Hexmage
Copy link
Author

Hexmage commented Aug 18, 2023

@engcom-Bravo
I should not be able to identify if an account exists or not. Because this could be used for targeted attacks on the customer's account or with an attempt at social engineering at the shop owner to get access to the customer account.

@engcom-Bravo
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-Bravo
Copy link
Contributor

Hi @Hexmage,

Thanks for your update.

As per this document https://developer.adobe.com/commerce/webapi/graphql/schema/customer/mutations/request-password-reset-email/ the requestPasswordResetEmail mutation used initiate the process to reset the registered customer's password and it is working fine for registered customers.

Regarding for Non-Existing account there is no information but we can consider it a good-to-have feature.

Hence marking this issue as a feature request.

Thanks.

@engcom-Bravo engcom-Bravo added feature request and removed Issue: needs update Additional information is require, waiting for response labels Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Progress: dev in progress Project: GraphQL Reported on 2.4.2 Indicates original Magento version for the Issue report.
Projects
Status: In Progress
Development

No branches or pull requests

2 participants