-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Cannot instantiate interface Magento\Csp\Model\Collector\MergerInterface
when Magento_Csp
is disabled
#39104
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
Comments
Hi @fritzmg. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @fritzmg , Magento updated CSP to restrict mode at checkout. |
Well Magento has support for CSP for some while now, not just recently. The issue is just with the |
I can confirm the issue with 2.4.6-p7 as well. File affected: }
}
- $this->cspNonceProvider = $cspNonceProvider ?: ObjectManager::getInstance()->get(CspNonceProvider::class);
+ try {
+ $this->cspNonceProvider = $cspNonceProvider ?: ObjectManager::getInstance()->get(CspNonceProvider::class);
+ } catch (\Throwable $e) {
+ $this->cspNonceProvider = null;
+ }
}
/** The checkout is also affected. A new Observer has been introduced: File affected: <event name="customer_logout">
<observer name="unsetAll" instance="Magento\Checkout\Observer\UnsetAllObserver" />
</event>
- <event name="controller_action_predispatch_checkout_index_index">
- <observer name="cps_storefront_checkout_index_index_predispatch"
- instance="Magento\Checkout\Observer\CspPolicyObserver"/>
- </event>
+<!-- <event name="controller_action_predispatch_checkout_index_index">-->
+<!-- <observer name="cps_storefront_checkout_index_index_predispatch"-->
+<!-- instance="Magento\Checkout\Observer\CspPolicyObserver"/>-->
+<!-- </event>-->
</config> |
Marcus, Default config: Commit REF: 25cf7f0#diff-32ed90c0e573d5dd4047b67db44768fca797fa1df717c8d883956d3a6b8d2fd6 I understand that someone from the Adobe team should clarify this. Previous discussion on Magento_Csp behavior change at checkout: #38823 Background info: https://m.academy/articles/magento-apsb24-40-security-patch-csp-checkout-updates/#:~:text=Impact%20on%20Checkout%20Functionality |
@Franciscof-Serfe please note, we are not on 2.4.7. We are on 2.4.6-p7; In a security release there should never be such a breaking change. |
Nevertheless, modules that have a hard dependency on |
The new CSP changes are new PCI requirements for all payment pages per PCI version 4 section 6.4.3. Since all of our supported versions must be PCI compliant this change had to be made. Having said that, it does appear there is an error with the type that violates our policies. But, I would strongly advise you to get your site working with CSP as this is the last line of defense against malware and card skimmers. Plus, it would put you at risk of PCI audit failure especially since the auditors will be on high alert since it's a new requirement. |
@magento export issue to Jira project AC as Bug |
❌ You don't have permission to export this issue. |
@magento export issue to Jira project AC as Bug |
❌ Something went wrong. Cannot create Jira issue. |
Is the Issue: Confirmed tab necessary first? |
@nathanjosiah While I agree that CPS should be enabled in any case, CSP must not be a requirement, at least not for this reason. Your shop does not have to have an actual payment module. In our case the Magento instance is a B2C shop with a checkout that contains no payment options. In our case the fix is easy, as we can just disable the payment module itself (it was an error that we didn't). The error is that |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-13063 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue. |
The same error happens within magento2/app/code/Magento/AdminAnalytics/ViewModel/Metadata.php Lines 75 to 77 in 5a2037c
It also has a hard dependency on magento2/app/code/Magento/AdminAnalytics/etc/module.xml Lines 8 to 10 in 5a2037c
|
I have the same problem here on 2.4.6-p8. It is supposed to be just a security patch, but now we have a CSP problem. |
Also reproduced for 2.4.8-p1 |
Preconditions and environment
Magento_Csp
disabledSteps to reproduce
2.4.7-p2
.bin/magento module:disable Magento_Csp
.Expected result
The checkout should be rendered.
Actual result
The following error is thrown:
Additional information
The cause are these lines within
vendor/magento/module-payment-services-paypal/Model/ConfigProvider.php
The error is not of type
\ReflectionException
, instead it is of type\Error
- thus the error is not caught.To fix it, it could be changed as follows:
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: