Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

vulnerability on PrestaShop sites

Featured Replies

1 hour ago, Theo said:

Does this work in TB. Can we apply verbatim? 

_PHP_ENCRYPTION_KEY_ key and PhpEncryption library have been in Thirty Bees since version 1.0.0.
I have already implemented this modification on several stores in versions 1.3.0 and 1.4.0. And it certainly works fine.

4 minutes ago, e-com said:

_PHP_ENCRYPTION_KEY_ key and PhpEncryption library have been in Thirty Bees since version 1.0.0.
I have already implemented this modification on several stores in versions 1.3.0 and 1.4.0. And it certainly works fine.

Not necessarily. TB supports multiple encryption methods, so php encryption key might not be defined. Use Encryptor::getInstance() instead.

Encryption and decryption of cache entries might be performance killer, though. I believe signature will be a better alternative here. Will do some benchmark testing.

23 minutes ago, datakick said:

Encryption and decryption of cache entries might be performance killer, though. I believe signature will be a better alternative here. Will do some benchmark testing.

It's a fact, all benchmarks have shown me that a smarty cache for MySQL is much slower than a cache for a filesystem (and with encryption it will be even slower).
That's why I do not use smarty cache for MySQL in any store 🙂

Fix is just so that there is no security hole.

Edited by e-com

5 minutes ago, e-com said:

It's a fact, all benchmarks have shown me that a smarty cache for MySQL is much slower than a cache for a filesystem (and with encryption it will be even slower).
That's why I do not use smarty cache for MySQL in any store 🙂

Fix is just so that there is no security hole.

yep, depending on a benchmark test results this functionality could be dropped completely. It is likely that added overhead of db query + decryption will erase any perfomance gains this cache has to offer 

On 7/28/2022 at 2:09 PM, datakick said:

Not necessarily. TB supports multiple encryption methods, so php encryption key might not be defined. Use Encryptor::getInstance() instead.

Encryptor is a new class in thirty bees, not existing in prestashop, so I missed it.
It will be better this way:
https://github.com/thirtybees/thirtybees/commit/ab1ebcbb181913d9b1400d2d95e468241e2be025

And a performance test from profiler. Smarty cache to file system is definitely more efficient.

Zaznaczenie_219.png

The proposed fix is in the bleeding edge, as a quick solution to this very serious issue.

Note #1: there is a significant performance overhead of encryption + base64 encoding / base64 decoding + decryption, which may render this cache totally useless. I did not make any performance tests yet, but plan to do so. If the test shows that the performance overhead is too big, we will drop this functionality completely. Tracked here: https://github.com/thirtybees/thirtybees/issues/1476

If you are using mysql smarty cache, please test yourself, and decide if different cache should be used instead.

Note #2: thirty bees already supports various server side caches (redis, apc, memcached), but this SSC is used only for Full Page Cache functionality. We should reuse this for smarty cache as well, which could give us quite a big performance boost. Tracked here https://github.com/thirtybees/thirtybees/issues/1477

Note #3: I would like to reiterate. This Smarty MySQL Cache vulnerability can be exploited if, and only if, your store already contains some SQL injection vulnerability. And if that is the case, you already have a huge problem. We don't know about any SQL injection vulnerability in thirty bees core or any native modules, but there may be some somewhere. But any third party module can have such vulnerability.

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.