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

GraphQl public catalog endpoints expose some data that should not be visible #30625

Closed
1 of 5 tasks
rogyar opened this issue Oct 23, 2020 · 9 comments · Fixed by #30694
Closed
1 of 5 tasks

GraphQl public catalog endpoints expose some data that should not be visible #30625

rogyar opened this issue Oct 23, 2020 · 9 comments · Fixed by #30694
Assignees
Labels
Milestone

Comments

@rogyar
Copy link
Contributor

rogyar commented Oct 23, 2020

Preconditions (*)

  1. Magento installation with CatalogGraphQl module enabled

Steps to reproduce (*)

Take a look at the ProductInterface

It allows retrieving some data for the non-authorized users that we usually expose neither on the standard storefront nor with the REST API.

For example, the following fields

  • special_from_date
  • special_to_date

are not supposed to be visible for a non-authorized client since this data exposes information about sales period that should be hidden by default.

The same about

  • created_at
  • updated_at
  • websites
  • attribute_set_id

Expected result (*)

  1. Only data that is required for rendering product details on the storefront is available

Actual result (*)

  1. Product data that is supposed to be visible for admin only is visible for non-authorized users

Proposed solution

At least, remove the following fields from the schema

  • special_from_date
  • special_to_date

The other fields mentioned in the issue need to be discussed


  • 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 Oct 23, 2020

Hi @rogyar. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ 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, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@misha-kotov
Copy link

Agree with these as well:

  • created_at
  • updated_at
  • websites
  • attribute_set_id

But if we remove them, will need to make sure sorting in categories still works (ex: if the category products are sorted by updated_at or created_at

@ghost ghost added this to Ready for Development in GraphQL Backlog Oct 23, 2020
@ghost ghost removed this from Ready for Confirmation in Issue Confirmation and Triage Board Oct 23, 2020
@cpartica
Copy link
Contributor

I can see a case where you have a "promotion" of a price and you want to say until when it's available: "1 day left"
It is true that created_at, updated_at shouldn't be there
Also attribute_set_id if we don't have a use case for it we can remove it.

The problem is that removing fields is backward incompatible and should be approved.
I can create an architectural proposal and try to get these flushed out

@rogyar
Copy link
Contributor Author

rogyar commented Oct 23, 2020

@cpartica. Thanks for sharing your thoughts, it makes sense.
We may add the possibility to see the special_to_date. But my point is GraphQL will be the only way to get this information without authorization. So, for existing stores, it means that if the merchant wants to keep this information publicly hidden (current behavior with the standard storefront) he needs to customize the system behavior.

As for the architectural proposal, If you could create that, it would be great. Thanks!

@mauragcyrus
Copy link

@rogyar could you please link the PR?

@andrewbess
Copy link
Contributor

@magento I'm working on it

@ghost ghost moved this from Ready for Development to Dev In Progress in GraphQL Backlog Oct 28, 2020
@ghost ghost moved this from Dev In Progress to Pull Request In Progress in GraphQL Backlog Oct 28, 2020
@rogyar rogyar added the Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. label Oct 29, 2020
@nrkapoor nrkapoor added this to the 2.4.2 milestone Oct 30, 2020
@m2-assistant
Copy link

m2-assistant bot commented Oct 30, 2020

Hi @cspruiell. 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).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. 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!

@m2-assistant
Copy link

m2-assistant bot commented Oct 30, 2020

Hi @mauragcyrus. 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).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. 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!

@m2-assistant
Copy link

m2-assistant bot commented Oct 30, 2020

Hi @cpartica. 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).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

8 participants