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.
http://www.magento.com
Open Software License 3.0
11.39k stars 9.29k forks source link

CSP Issue with DOB field #38894

Closed mahesh-singh-pinja closed 13 hours ago

mahesh-singh-pinja commented 2 weeks ago

Preconditions and environment

Steps to reproduce

  1. Enable strict CSP mode.
  2. Enable show DOB field from admin on customer registration.

    This will add dob field with this script https://github.com/magento/magento2/blob/2.4-develop/lib/internal/Magento/Framework/View/Element/Html/Date.php#L31

    It should add nonce on this script

Expected result

No CSP warning in console.

Actual result

CSP warning in console.

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 weeks ago

Hi @mahesh-singh-pinja. 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:

mahesh-singh-pinja commented 2 weeks ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 weeks ago

Hi @mahesh-singh-pinja. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 weeks ago

Hi @mahesh-singh-pinja, here is your Magento Instance: https://06f3e86aaac749daad3c169a1f77b4af.instances-prod.magento-community.engineering Admin access: https://06f3e86aaac749daad3c169a1f77b4af.instances-prod.magento-community.engineering/admin_13d1 Login: 85768697 Password: 0d8edd4895d9

m2-assistant[bot] commented 2 weeks ago

Hi @engcom-Bravo. 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:

m2-assistant[bot] commented 2 weeks ago

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: :point_down:

engcom-Hotel commented 2 weeks ago

Hello @mahesh-singh-pinja,

Thanks for the report and collaboration!

We have tried to reproduce the issue in the latest development branch of Magento ie 2.4-develop but it seems the issue is not reproducible for us. To enable the strict CSP mode. We have created a custom module with the following config.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/config.xsd">
    <default>
        <csp>
            <mode>
                <storefront>
                    <report_only>0</report_only>
                </storefront>
                <admin>
                    <report_only>0</report_only>
                </admin>
            </mode>
        </csp>
    </default>
</config>

And then enable the module. However, we are not seeing any CSP warning in the console. Please have a look at the below screenshot for reference: image

But let us know if we have missed anything here.

Thanks

engcom-Hotel commented 13 hours ago

Dear @mahesh-singh-pinja ,

We've observed that there haven't been any updates on this issue for quite some time. Therefore, we're assuming it's been resolved and will be closing it. Feel free to open a new ticket or reopen this one if you require further assistance.

Regards