Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-474

AmqPlain & Plain SaslServer don't check passwords

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • M1, M2, M2.1
    • M3
    • Broker-J
    • None

    Description

      This is a snippet from the evaluateResponse method in AmqPlainSaslServer:

      String pwd = new String(response, authcidNullPosition + 1, passwordLen, "utf8");
      passwordCb.setPassword(pwd.toCharArray());
      AuthorizeCallback authzCb = new AuthorizeCallback(authzid, authzid);
      Callback[] callbacks = new Callback[]

      {nameCb, passwordCb, authzCb}

      ;
      _cbh.handle(callbacks);
      _complete = true;

      The authzCb is always set to true!!

      See the handler UsernamePasswordInitialiser
      else if (callback instanceof AuthorizeCallback) {
      ((AuthorizeCallback) callback).setAuthorized(true);

      As a result this will always allow access.
      (from AmqPlainSaslServer.evaluteResponse() .. follows on from above snippet)

      if (authzCb.isAuthorized())

      { _authorizationId = authzCb.getAuthenticationID(); return null; }

      else

      { throw new SaslException("Authentication failed"); }

      What needs to be done:

      This line is wrong: (from AmqPlainSaslServer)
      passwordCb.setPassword(pwd.toCharArray());

      This is done in the PrincipalDatabases

      So after the handle call

      passwordCb.getPassword() should be compared to pwd verifying the password is correct.

      Attachments

        Issue Links

          Activity

            People

              aidan Aidan Skinner
              ritchiem Martin Ritchie
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: