Cookie mage-messages has secure flag not set
mdevrees opened this issue · comments
Preconditions and environment
- Magento version 2.4.6-p5 Commerce edition
- PHP 8.2
Steps to reproduce
- Trigger the creation of the mage-messages cookie by for example adding a product to cart
- In
\Magento\Theme\Controller\Result\MessagePlugin::setCookie
themage-messages
cookie is created - In the
setCookie
method the$publicCookieMetadata->setSecure($this->sessionConfig->getCookieSecure());
is not set / missing and apparently not marking the mage-messages as secure. If I addsetSecure
the mage-messages cookie is marked secure:
Expected result
I expected the mage-messages cookie to be also set as secure.
Actual result
The mage-messages
cookie isn't marked as secure.
Additional information
I've tried searching for this specific issue in the github issue tracker but could not find any.
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”.
Hi @mdevrees. 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:
@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.
🕙 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.
Hi @engcom-Hotel. 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
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced 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.
Hello @mdevrees,
Thanks for the report and collaboration!
We have tried to reproduce the issue in the 2.4-develop branch and we have observed that the mage-messages
cookie not secure. But it seems it is working as expected.
Please go through the documentation related to it:
And let us know the use case where you need this cookie should be secure.
Thanks
Seeing the compliance cookie law regarding mage-messages, then yes, you are correct in it not being (or having to be) secure.
The cookie not being secure was a point of action coming from a security scan. In order to comply with that, I added the change mentioned in the Steps to Reproduce in the description of this ticket.
Thank you, @mdevrees, for your response!
Given that this issue has been flagged in your security scan, it's possible that others may encounter it too. Therefore, we'll proceed by treating this as a "feature request."
Appreciate it!