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
When the connection string is malformed, go-mssqldb might return an error that contains the username and password, which might be logged by the caller and cause credentials leak.
This is caused by a late url.Parse call which might include the entire connection URL in the error message.
the error returned from conn.Query reveals the connection credentials
Error: Received unexpected error:
parse "sqlserver://username:password@[foo].bar:1433?database=foo&encrypt=true&ssl=require": invalid port ".bar:1433" after host
Expected behaviour
The error does not include credentials (username/password)
Further technical details
SQL Server version: doesn't matter. this error happens on the client side.
Operating system: macOS 14.5 on M1 CPU
Table schema: doesn't matter. this error happens on the client side.
Notes
The issue happens when the caller provides a malformed connection string. However, it's still undesirable for go-mssqldb to return an error that could lead to the leak of connection credentials. Especially that the error isn't returned in sql.Open, but later on conn.Query, so the error can not be easily handled centrally.
The text was updated successfully, but these errors were encountered:
Describe the bug
When the connection string is malformed, go-mssqldb might return an error that contains the username and password, which might be logged by the caller and cause credentials leak.
This is caused by a late
url.Parse
call which might include the entire connection URL in the error message.Stack trace
Steps to reproduce
Actual behaviour
the error returned from
conn.Query
reveals the connection credentialsExpected behaviour
The error does not include credentials (
username
/password
)Further technical details
SQL Server version: doesn't matter. this error happens on the client side.
Operating system: macOS 14.5 on M1 CPU
Table schema: doesn't matter. this error happens on the client side.
Notes
The issue happens when the caller provides a malformed connection string. However, it's still undesirable for go-mssqldb to return an error that could lead to the leak of connection credentials. Especially that the error isn't returned in
sql.Open
, but later onconn.Query
, so the error can not be easily handled centrally.The text was updated successfully, but these errors were encountered: