Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-42163

CHECKSUM TABLE allows to deduce a value that the user cannot select

    XMLWordPrintable

Details

    • Notable changes

    Description

      CHECKSUM TABLE requires only SELECT privilege on at least some columns of the table, not all. But it returns a checksum calculated over all columns.

      If the user has SELECT on all columns but one. And the table has only one row. The user can solve the equation and derive the hidden column value (for certain column types) from the other columns and the checksum. Like

      CREATE TABLE users (id INT, name VARCHAR(100), salary INT);
      INSERT users VALUES (1, 'John Doe', 123456);
      CREATE USER u@localhost;
      GRANT SELECT (id, name) ON test.users TO u@localhost;
      --connect u,localhost,u
      SELECT id,name FROM users;
      CHECKSUM TABLE users;
      

      Note that the documentation is wrong, it says

      CHECKSUM TABLE requires the SELECT privilege for the table.

      let's make it correct and change the code to require, indeed, the SELECT privilege for the whole table.

      Reported by Yalguun Tumenkhuu

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.