Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-25167

[Backport MB-25103] - Authentication Fails When Colon Character ":" Exists in Password

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.6.3
    • 4.6.1
    • query
    • Security Level: Public
    • Ubuntu Server 14.04, nginx, PHP-FPM 7.1, CB PHP SDK 2.3.3, CB Server 5.0 beta
    • Triaged
    • Unknown

    Description

      One of our prospects working with PHP SDK found a potential bug.  He tried a password with a colon (":") character, and it doesn't seem to work from a test PHP script.

       

      Steps to reproduce:

      • Create a user with at least "read" permissions to a bucket and a password with a ":" character.  For this test, I created "admin" user with "zzz:zzz" password on 'travel-sample' bucket.

      - Try running a N1QL query against the bucket via N1QL REST API.  Here is a URL to test from Postman app for Chrome or similar REST client:

      http://127.0.0.1:8093/query/service?statement=select%20a.name%2Cr.destinationairport%2C%20count(a.name)%20total_flights%20from%20%60travel-sample%60%20r%20join%20%60travel-sample%60%20a%20on%20keys%20r.airlineid%20where%20r.type%20%3D%22route%22%20and%20a.type%3D%22airline%22%20group%20by%20r.destinationairport%2C%20a.name%20order%20by%20r.destinationairport&creds=[{"user":"admin","pass":"zzz:zzz"}

      - Try reading from the same bucket with a PHP script.  Below is the sample script:

       

       

      <?php
      #$cluster = new CouchbaseCluster("couchbase://10.211.55.2"); # Connect from Parallels Desktop VM
      $cluster = new CouchbaseCluster("couchbase://127.0.0.1"); # Connect from Parallels Desktop VM
      #$cluster->authenticateAs("admin1", "password");
      $cluster->authenticateAs("admin", "zzz:zzz");
      $bucket = $cluster->openBucket('travel-sample');
      $query = CouchbaseN1qlQuery::fromString('SELECT `name` FROM `travel-sample` WHERE `name` IS NOT NULL LIMIT 10');
      $result = $bucket->query($query);
       
      foreach ($result->rows as $row)
      {
          var_dump($row);
      }
      ?>
       
      

       

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ajay.bhullar Ajay Bhullar
              oleg.kuzmin Oleg Kuzmin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty