Skip to content

fix: avoid direct access to reviews list AJAX #33876

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

Open
wants to merge 5 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

iparmentier
Copy link

@iparmentier iparmentier commented Aug 20, 2021

Description (*)

Do not know wether it is intentional,
But you can access directly to the reviews list Ajax controller however all others controllers for Ajax URL has a conditional test in code.

Capture d’écran 2021-08-20 à 20 32 39

Fixed Issues (if relevant)

Why not restrain this page to Ajax only

Manual testing scenarios

You can give it a try :
/review/product/listAjax/id/9999
=> Display the raw output in the browser.

(9999 = product if from store)

Questions or comments

Give me your think,

Ilan Parmentier

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Avoid direct access to reviews list Ajax #37920: Avoid direct access to reviews list Ajax

Good evening,

Do not know wether it is intentional,

But you can access directly to the reviews list Ajax controller 

You can give it a try :
/review/product/listAjax/id/111111616
=> Display the raw output in the browser.

Why not restrain this page to Ajax only.

Give me your think,

Ilan Parmentier
@m2-assistant
Copy link

m2-assistant bot commented Aug 20, 2021

Hi @mageho. Thank you for your contribution
Here are some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests 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 Pull Requests 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

@iparmentier
Copy link
Author

@magento give me test instance

@magento-deployment-service
Copy link

Hi @mageho. Thank you for your request. I'm working on Magento instance for you.

@iparmentier
Copy link
Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento-deployment-service
Copy link

@bgorski
Copy link
Contributor

bgorski commented Aug 21, 2021

@mageho thank you for your contribution! Indeed, this action can be accessed directly and if indexed by search engines, it may contribute to bad user experience. I had one change request though - please address it and I think we're good to go.

@iparmentier
Copy link
Author

@bgorski Hello there, I did the modification by following your advice. We must be good to go. have a nice weekend.

Copy link
Contributor

@bgorski bgorski left a comment

Choose a reason for hiding this comment

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

@mageho indeed we are - approving the PR. The next step is to wait for the core team to prioritize this and to perform manual testing.
Thank you for your contribution!

@bgorski
Copy link
Contributor

bgorski commented Aug 21, 2021

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento-engcom-team
Copy link
Contributor

Hi @bgorski, thank you for the review.
ENGCOM-9191 has been created to process this Pull Request
✳️ @bgorski, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@bgorski bgorski added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Aug 21, 2021
@bgorski
Copy link
Contributor

bgorski commented Aug 22, 2021

@magento run Unit Tests, Functional Tests CE, Functional Tests B2B

@engcom-Lima
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@engcom-Lima
Copy link
Contributor

@magento give me test instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@engcom-Lima
Copy link
Contributor

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop and PHP 8.1

Manual testing scenario:

  • Add /review/product/listAjax/id/{productID} after the instance frontend URL and hit.

Before: ✖️ Showing the reviews list.
Screenshot 2023-08-25 at 3 53 14 PM

Screenshot 2023-08-25 at 3 46 39 PM

After: ✔️ Now no direct access to reviews list.

Screenshot 2023-08-25 at 4 08 45 PM

Builds are failed. Hence, moving this PR to Extended Testing.

@engcom-Lima
Copy link
Contributor

@magento create issue

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Static Tests

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests B2B, Unit Tests

@engcom-Charlie
Copy link
Contributor

@iparmentier iparmentier changed the title Avoid direct access to reviews list Ajax fix: avoid direct access to reviews list AJAX Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Component: Review Priority: P3 May be fixed according to the position in the backlog. Progress: ready for testing Release Line: 2.4
Projects
Status: Merge in Progress
Development

Successfully merging this pull request may close these issues.

[Issue] Avoid direct access to reviews list Ajax
7 participants