Open oskar-olaussen opened 2 years ago
Hi @oskar-olaussen. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
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:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: 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.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @engcom-November. 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: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If 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.
[ ] 2. 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.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- 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.
Verified the issue on Magento 2.4-develop branch On modifying option value of Conditions section in browser's inspect of Cart Price Rule, and selecting the same value in UI that has been modified, error is displayed and user is redirected to dashboard page.
Exception stack trace: ` [2022-02-24T08:57:03.500455+00:00] main.ERROR: Class Magento\Quote\Model\CoponManagement does not exist [] [] [2022-02-24T08:57:03.501371+00:00] main.CRITICAL: ReflectionException: Class Magento\Quote\Model\CoponManagement does not exist in /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Code/Reader/ClassReader.php:34 Stack trace:
`
@nathanjosiah, just tagging you in here, sounds security related.
:x: You don't have permission to export this issue.
@hostep I don't see an issue with this. When the rule model loads the post data there is a check that the requested class implements the ConditionInterface. The error in this report is due to a typo (Magento\Quote\Model\CoponManagement
should be Magento\Quote\Model\CouponManagement
) but even if it was correct, the class is loaded into memory but never instantiated because it doesn't implement that interface. In fact, it will throw a Class does not implement condition interface
error which is simply logged and then completely ignored. Any class that implements that interface seems like it should be allowed in this context.
@nathanjosiah Thanks for the response! Not currently on my work computer but I'm fairly certain that by following the steps I provided the error logged was about the method setId not existing in the class provided, implying that the class was instantiated and then the method was called on it. The code uses the object manager directly so are you sure the flow goes through the factory referenced?
Verified the issue again on Magento 2.4-develop branch by correcting typo mistake. Please find the observations below: On modifying option value of Conditions section in browser's inspect of Cart Price Rule, and selecting the same value in UI that has been modified, error is displayed and user is redirected to dashboard page.
` [2022-03-07T08:08:28.132405+00:00] main.CRITICAL: Error: Call to undefined method Magento\Quote\Model\CouponManagement::setId() in /var/www/html/mg24/magento2/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/NewConditionHtml.php:31 Stack trace:
`
@oskarolaussen @engcom-November I see the issue, it is with the Html retrieval controller https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/NewActionHtml.php#L32
This is definitely not ideal and there should be a validation check here but I don't see how this could be attacked with how it is currently written. I have created a ticket for this internally as a defense-in-depth ticket but it looks very unlikely to be exploitable as-is. There would need to be a class that can cause harm by having setId
and/or setType
methods and the arguments to those method have to be strings that are solely used to perform some type of malicious behavior. It's theoretically possible but would require some terrible class design for it to be plausible.
Ticket created https://jira.corp.magento.com/browse/AC-2571
Thanks for the update @nathanjosiah. Confirming the issue.
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2581 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @SergeyP18. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
Preconditions (*)
Steps to reproduce (*)
Create a new Cart Price Rule
Modify value of Conditions option value in browser's inspect. For example:
Select the option that you have modified.
Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.