[MXS-2788] Masking filter performs case-sensitive checks against unquoted case-insensitive identifiers in function calls and WHERE clauses Created: 2019-12-04  Updated: 2020-08-25  Resolved: 2019-12-05

Status: Closed
Project: MariaDB MaxScale
Component/s: masking
Affects Version/s: 2.4.4
Fix Version/s: 2.3.16, 2.4.5

Type: Bug Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None


 Description   

Let's say that a user has the following rule set:

    {
      "replace": {
        "column": "COLNAME"
      },
      "with": {
        "value": ".",
        "fill": "."
      }
    },

Then the following queries are properly rejected:

> select COLNAME, upper(COLNAME) from TABNAME limit 10;
ERROR 1141 (HY000): The function upper is used in conjunction with a field that should be masked for 'user'@'::ffff:...', access is denied.
 
> select COLNAME from TABNAME where COLNAME like '1%' limit 10;
ERROR 1141 (HY000): The function upper is used in conjunction with a field that should be masked for 'user'@'::ffff:...', access is denied.

However, if the same columns are referred to in lowercase (and unquoted), then the filter allows the queries:

> select colname, upper(colname) from tabname limit 10;
 
> select colname from tabname where colname like '1%' limit 10;


Generated at Thu Feb 08 04:16:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.