Skip to content

Error messages are still outputting sensitive information #1242

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

Open
robert-sjoblom opened this issue Mar 10, 2025 · 1 comment
Open

Error messages are still outputting sensitive information #1242

robert-sjoblom opened this issue Mar 10, 2025 · 1 comment

Comments

@robert-sjoblom
Copy link

Describe the Bug

#1161 was closed as fixed by #1162. We're still seeing sensitive information being logged, though:

failed to migrate database: failed to create new migrations: failed to open database: parse "pgx://user2:3M8s8!EQ48wh^cw%!E(bool=true)HEUApA9@<host>:<port>/db?sslmode=require&application_name=appname-859675d96c-p4sbc&statement_cache_mode=describe&x-lock-strategy=table&x-multi-statement=%!t(MISSING)": net/url: invalid userinfo

Steps to Reproduce

Our error stemmed from the fact that the user that migrated (user2) wasn't a member of a group (pgbouncer), and so the login was rejected at the pg_hba level. However, you get the same behavior when you're connecting to a database with the wrong password.

An amateur's guess is that this might be the reason/origin:
https://github.com/golang-migrate/migrate/blob/master/database/driver.go#L85C1-L100C1

Expected Behavior
No sensitive information is logged.

Migrate Version
v4.18.2

@dhui
Copy link
Member

dhui commented Apr 17, 2025

I think this is related to your other issue where the password doesn't have reserved URL characters escaped.
Specifically, this: parse "...": net/url: invalid userinfo

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

2 participants