Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5092

RequestTokenService signature verification bug [OAuthUtils]

    XMLWordPrintableJSON

Details

    • Novice

    Description

      When accessing the RequestTokenService of the cxf-rt-rs-security-oauth framework, consumer key and secret will be used to validate the signature of the sent message. When signature fails (ie. wrong clientsecret), an exception is thrown and catched, but since the actual requesttoken is null at that time, the exception is not thrown any further and the requesttoken will be generated afterwards and passed to the connected client even when the signature verification failed. See snippet of the OAuthUtils class.

      [2.7.5 - lines 107-114]

      try

      { validator.validateMessage(oAuthMessage, accessor); }

      catch (Exception ex) {
      if (token != null)

      { provider.removeToken(token); throw ex; }

      }

      If I'm correct, a possible solution will be to move the throw exception statement out of the if statement so that in case of catched exception it's always thrown further.

      This is a minor bug, since in the next oauth step the signature verification will fail and since the token will not be null in this case, the exception is thrown the oauth flow will end unsuccesful.

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            vdveer vdveer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified