[wp-trac] [WordPress Trac] #52253: New filter on wp-db.php

WordPress Trac noreply at wordpress.org
Fri Jan 8 18:54:25 UTC 2021


#52253: New filter on wp-db.php
-------------------------------+------------------------------
 Reporter:  guelben            |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Database           |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by guelben):

 Hi John,

 Thank you for your reply. That would be the description of the plugin:

  "Encrypts your Users Personal Data in your database, and decrypts them
 when they need to be displayed or accesed. Helps you comply with the EU
 GDPR law and CCPA regulations. We recommend to use this plugin in
 combination with a system backup. That way, in case you suffer a MySQL
 Ransomware Attack you do not have to inform the government neither your
 users."


 So the plugin helps to reduce the impact of such kind of malware which are
 unfortunately increasing.

 As far the plugin works nicely in my testings.  When the admin installs
 the plugin he can encrypt the data using a AES 128 cypher of a large
 amount of users via ajax utilities. Then the subsequent records are
 automatically encrypted. I have implemented measures like marcage of
 cypered data (only being cyphered once, not being decyphered if not
 encrypted), storage of the keys in a safe place, decrypting the whole
 database when needed, data stats displayed in admin etc ..

 The problem is that right now it works perfectly because I have edited the
 wp-db.php file. Of course I need to avoid this as I want my plugin to be
 an official one. I tried really hard to find an alternative using more
 than a dozen of existing filters but even so not all of the values could
 be intercepted. I ended up using deciphering on cache which of course is
 an horrible solution cause it does not cover many contexts. I found
 specially problematic filtering the values coming from `users` table (had
 more luck with `usermeta`).

 With the filters I propose I am able to intercept all cyphered values and
 decrypt the personal data in a strict and secure way.

 Since version 2.1.0 the filter ‘query’ is located at wp-db.php. It makes
 sense to also have a hook for filtering the returned raw data.


 Thanks,

 Javier

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52253#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list