Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-965

SecureQueryDecryptProcessor decode call could return null thus it would get a NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.11.0, 0.12.0, 0.13.0
    • 0.13.0
    • Server
    • None
    • All

    Description

      SecureQueryDecryptProcessor decode call could return null thus it would get a NPE

      We should look for decode return value and it is null should return :
      UrlRewriteStepStatus.FAILURE instead of try to process return null value.

      For example if encode fail you may get:

      Failed to rewrite URL: https://edl-test-primary.bde-np.info53.com:8443/gateway/default/webhdfs/data/v1/webhdfs/v1/landing/incoming/bcaps/TEMPG_TBA_OAFAPV10_MSTR_APP_VER_PAYMENT_SCHEDULE/TEMPG_TBA_OAFAPV10_MSTR_APP_VER_PAYMENT_SCHEDULE.del?_=AAAACAAAABAAAACQPRSZG4oUO6HBLU0Jhgy7Uzxx1SqYAyMtiwpBg2BYbeQwuoeCCaT7ZuP98H1XYHAvnDtPEiWPSZ5E9L_wfgk8feUD1KRMNPtV4JcYs5HZQxV7DLNHJ2U4TS_3ozHHQIr92g0gUNH1wcLWVYwlEy5YKUC-tGKlMBBaJdlbvJ426hoLVfh4g3RuEG_-m3-DRu8nnoccpjeh3DsO1Z9S7zPfzXIl5lkLznfd, direction: IN, rule: WEBHDFS/webhdfs/inbound/datanode
      java.lang.NullPointerException
      at java.util.StringTokenizer.<init>(StringTokenizer.java:199)
      at java.util.StringTokenizer.<init>(StringTokenizer.java:221)
      at org.apache.hadoop.gateway.securequery.SecureQueryDecryptProcessor.process(SecureQueryDecryptProcessor.java:66)
      at org.apache.hadoop.gateway.filter.rewrite.impl.UrlRewriteStepProcessorHolder.process(UrlRewriteStepProcessorHolder.java:101)
      at org.apache.hadoop.gateway.filter.rewrite.impl.UrlRewriteStepProcessorHolder.processActions(UrlRewriteStepProcessorHolder.java:199)
      at org.apache.hadoop.gateway.filter.rewrite.impl.UrlRewriteStepProcessorHolder.processAndFlow(UrlRewriteStepProcessorHolder.java:156)
      at org.apache.hadoop.gateway.filter.rewrite.impl.UrlRewriteStepProcessorHolder.process(UrlRewriteStepProcessorHolder.java:114)
      at org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteProcessor.rewrite(UrlRewriteProcessor.java:151)
      at org.apache.hadoop.gateway.filter.rewrite.impl.UrlRewriteRequest.getTargetUrl(UrlRewriteRequest.java:114)
      at org.apache.hadoop.gateway.filter.rewrite.impl.UrlRewriteRequest.getRequestURI(UrlRewriteRequest.java:141)
      at org.apache.hadoop.gateway.filter.rewrite.impl.UrlRewriteRequest.getRequestURL(UrlRewriteRequest.java:134)
      at javax.servlet.http.HttpServletRequestWrapper.getRequestURL(HttpServletRequestWrapper.java:241)
      at org.apache.hadoop.gateway.dispatch.GatewayDispatchFilter.getDispatchUrl(GatewayDispatchFilter.java:116)

      Attachments

        1. KNOX-965.001.patch
          10 kB
          Jeffrey E Rodriguez

        Activity

          People

            jeffreyr97 Jeffrey E Rodriguez
            jeffreyr97 Jeffrey E Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: