Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password with equal sign (=) not stripped from keyword/value connection string #361

Open
okonos opened this issue May 5, 2022 · 0 comments

Comments

@okonos
Copy link
Contributor

okonos commented May 5, 2022

Example connection string:

user=db_user dbname=mydb password=my*passw?o=rd host=localhost port=5432 sslmode=disable timezone=UTC

No error is produced, the password is silently leaked into the segments.

If you happen to have stumbled upon this issue looking for solution, this can be worked around using URI format and escaping the password with net/url.PathEscape:

url := "postgres://db_user:" + url.PathEscape("my*passw?o=rd") + "@localhost:5432/mydb?sslmode=disable&timezone=UTC"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant