Skip to content

Passwords containing spaces result in failed auth #1716

@jaapie

Description

@jaapie

When connecting to a Redis instance with a password that contains a space, node-redis fails to authorise after connecting and gives the following error:

/home/jacob/rbcc/dev/warden/node_modules/redis-parser/lib/parser.js:179
    return new ReplyError(string)
           ^

ReplyError: ERR invalid password
    at parseError (/home/jacob/rbcc/dev/warden/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/home/jacob/rbcc/dev/warden/node_modules/redis-parser/lib/parser.js:302:14)

Redis configured to ask for auth: requirepass "blah blah"
node-redis connecting with:

client = redis.createClient({                                                                                                                                                                                                                                                                                          
    url: `redis://:${password}@${address}:${port}`                                                                                                                                                                                                                                                                     
}); 

Using a password with no spaces connects and authorises correctly.

Environment:

  • Node.js Version: 16.3.0
  • Redis Server Version: v=5.0.7 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=636cde3b5c7a3923
  • Node Redis Version: 4.0.0-rc.3
  • Platform: Client: Ubuntu 20.04.3 LTS, Server: Ubuntu 20.03.4 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions