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

Cookie mage-messages has secure flag not set #38681

Open
1 of 5 tasks
mdevrees opened this issue Apr 30, 2024 · 5 comments
Open
1 of 5 tasks

Cookie mage-messages has secure flag not set #38681

mdevrees opened this issue Apr 30, 2024 · 5 comments
Assignees
Labels
feature request Progress: dev in progress Reported on 2.4.6-p5 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@mdevrees
Copy link

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”.
Copy link

m2-assistant bot commented Apr 30, 2024

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.

@m2-community-project m2-community-project bot added this to Ready for Confirmation in Issue Confirmation and Triage Board Apr 30, 2024
@engcom-Bravo engcom-Bravo added Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it Reported on 2.4.6-p5 Indicates original Magento version for the Issue report. labels Apr 30, 2024
@engcom-Hotel engcom-Hotel self-assigned this May 3, 2024
Copy link

m2-assistant bot commented May 3, 2024

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.

@engcom-Hotel
Copy link
Contributor

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

@engcom-Hotel engcom-Hotel added Issue: needs update Additional information is require, waiting for response and removed Issue: ready for confirmation labels May 3, 2024
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board May 3, 2024
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board May 3, 2024
@mdevrees
Copy link
Author

mdevrees commented May 7, 2024

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.

@engcom-Hotel
Copy link
Contributor

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!

@engcom-Hotel engcom-Hotel added feature request and removed Issue: needs update Additional information is require, waiting for response labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Progress: dev in progress Reported on 2.4.6-p5 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Development

No branches or pull requests

3 participants