You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 12, 2025. It is now read-only.
Within parseConfigError, it attempts to redact any user password. Unfortunately, if url.Parse fails for any reason, it simple proceeds with the DSN parsing logic, which causes a password to be leaked if it is part of the connection string.
I hit this by fuzz-testing some input on connection strings. In my case, I set port as "abc" and then got back the full DSN (including the password) back in the error message.
My hunch is if the string begins with postgres:// or postgresql:// and the URL cannot be parsed, it would be more safe to be cautious and not return the original connection string in the error message. It might be valuable to have redactPW return an error and perhaps adjust the behavior accordingly.
Within
parseConfigError, it attempts to redact any user password. Unfortunately, if url.Parse fails for any reason, it simple proceeds with the DSN parsing logic, which causes a password to be leaked if it is part of the connection string.I hit this by fuzz-testing some input on connection strings. In my case, I set port as "abc" and then got back the full DSN (including the password) back in the error message.
My hunch is if the string begins with
postgres://orpostgresql://and the URL cannot be parsed, it would be more safe to be cautious and not return the original connection string in the error message. It might be valuable to haveredactPWreturn an error and perhaps adjust the behavior accordingly.