-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Preconditions and environment
- CE2.4.8-p3
Steps to reproduce
Run command encryption:key:change
Expected result
A new key is generated like:
'crypt' => [
'key' => 'base64bl3KKXTaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxJaePm6wFw='
],
Actual result
Key is added to existing keys:
'crypt' => [
'key' => 'a92c7xxxxxxxxxxxxxxxxxxxxdf6405
a0faa2xxxxxxxxxxxxxxxxxxxxxxb8a09c4
base64bl3KKXTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxJaePm6wFw='
],
Additional information
When we applied the fix for CosmicString (2.4.6), including rotating keys, we were left with an env file looking like:
'crypt' => [
'key' => 'a92c7xxxxxxxxxxxxxxxxxxxxdf6405
a0faa2xxxxxxxxxxxxxxxxxxxxxxb8a09c4
],
At the time there was no clear explanation why we apparently had two keys when using admin to change the key; everything says there should just be one. Some observers thought it needed to keep the old to stop things breaking. The site has been repeatedly hacked via hidden CMS block injection since applying the "fix".
Now we're on 2.4.8-p3, key rotation is still not behaving as expected. It adds to existing keys instead of actually rotating it. If we remove the old keys so there's just a single new key, all looks good until we fully clear caches (including view_preprocessed, page_cache and cache). Then Stripe stops working. No errors in browser, server or Magento logs - just no Stripe payment option. Restore previous keys and it works again. Only thing we see is multiple errors like the following when adding products to cart:
Could not retrieve customer profile: Warning: Attempt to read property "customers" on null in .../vendor/stripe/module-payments/Model/StripeCustomer.php on line 315
- How do we properly fix CosmicString without breaking our site?
- Why does encryption:key:change add another key instead of changing/rotating as documented?
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”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status