Uploaded image for project: 'Hue (READ ONLY)'
  1. Hue (READ ONLY)
  2. HUE-4413

[dbms] Security: Full XSS in DBQuery editor

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.10.0
    • Fix Version/s: 3.11.0
    • Component/s: core.api
    • Labels:
      None

      Description

      Problem

      Any text in rows returned from DBQuery/librdbms can contain arbitrary HTML and therefore a simple xss like <svg id=alert(1) onload=eval(id)></svg> will give anyone with write access to the database (in our case any user of our e-commerce platform) the ability to hijack Hue sessions.

      To Reproduce

      1. Load payload into MySQL/other database

      CREATE DATABASE testdb;
      use testdb;
      CREATE TABLE testsql2 (field1 INTEGER, field2 LONGTEXT);
      INSERT INTO `testsql2` VALUES (1,'<svg id=alert(1) onload=eval(id)></svg>');
      

      2. Go to DBQuery interface
      3. Run a query like:

      SELECT * FROM testdb.testtable;
      

      4. See alert pop up with text "1"

      Solution

      My fix that I applied (perhaps temporarily) is attached. I escape text as it comes out of the rdbms api.

        Attachments

          Activity

            People

            • Assignee:
              JackMcShopify Jack McCracken
              Reporter:
              JackMcShopify Jack McCracken
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: