Skip to content

Improper invalidation of mysql connection string #809

Closed
@kossidts

Description

@kossidts

Describe the bug
I am getting the error Invalid connection string format when trying to connect to the mysql db.

How To Reproduce (best to provide workable code or tests!)
Use a password that contains special characters or even just "-" in the connection string.
E.g. mysql://user:pass-1@localhost:3306/dbname

The source of the error seems to be in the parseConnectionString function located in the pool.js file. I guess the regex
const uriRegex = /^(\w+):\/\/(\w+)(?::(\w+))?@([\w.]+)(?::(\d+))?\/(\w+)$/;
is kept too simple. It should allow special characters especially for passwords.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions