Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-20644

Avoid exposing sensitive infomation through a Hive Runtime exception

    XMLWordPrintableJSON

Details

    Description

      The HiveException raised from the following methods is exposing the datarow the caused the run time exception.

      1. ReduceRecordSource::GroupIterator::next() - around line 372
      2. MapOperator::process() - around line 567
      3. ExecReducer::reduce() - around line 243

      In all the cases, a string representation of the row is constructed on the fly and is included in
      the error message.

      VectorMapOperator::process() - around line 973 raises the same exception but it's not exposing the row since the row contents are not included in the error message.

      While trying to reproduce above error, I also found that the arguments to a UDF get exposed in log messages from FunctionRegistry::invoke() around line 1114. This too can cause sensitive information to be leaked through error message.

      This way some sensitive information is leaked to a user through exception message. That information may not be available to the user otherwise. Hence it's a kind of security breach or violation of access control.

      The contents of the row or the arguments to a function may be useful for debugging and hence it's worth to add those to logs. Hence proposal here to log a separate message with log level DEBUG or INFO containing the string representation of the row. Users can configure their logging so that DEBUG/INFO messages do not go to the client but at the same time are available in the hive server logs for debugging. The actual exception message will not contain any sensitive data like row data or argument data.

      Attachments

        1. HIVE-20644.01
          5 kB
          Ashutosh Bapat
        2. HIVE-20644.02
          5 kB
          Ashutosh Bapat
        3. HIVE-20644.03
          5 kB
          Ashutosh Bapat
        4. HIVE-20644.04
          9 kB
          Ashutosh Bapat
        5. HIVE-20644.05
          9 kB
          Ashutosh Bapat
        6. HIVE-20644.05
          9 kB
          Ashutosh Bapat
        7. HIVE-20644.06
          9 kB
          Ashutosh Bapat
        8. HIVE-20644.06
          9 kB
          Ashutosh Bapat
        9. HIVE-20644.06
          9 kB
          Ashutosh Bapat

        Issue Links

          Activity

            People

              ashutosh.bapat Ashutosh Bapat
              ashutosh.bapat Ashutosh Bapat
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: