magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.

Home Page:http://www.magento.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Trigger the creation of the mage-messages cookie by for example adding a product to cart
  2. In \Magento\Theme\Controller\Result\MessagePlugin::setCookie the mage-messages cookie is created
  3. 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 add setSecure the mage-messages cookie is marked secure:

Screenshot 2024-04-30 at 14 16 20

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:


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.

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 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.

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:

https://experienceleague.adobe.com/en/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law#mage-messages

And let us know the use case where you need this cookie should be secure.

Thanks

Hi @engcom-Hotel

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!