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
The simplest mitigation would be to obfuscate all source file names in MySqlBulkLoader.LoadAsync; that is, if a file name is specified, open it for reading then treat it as a SourceStream. In ResultSet.ReadResultSetHeaderAsync, only allow "file names" that begin with MySqlBulkLoader.StreamPrefix. This would prohibit arbitrary filesystem paths from being requested.
This would break clients who manually construct a LOAD DATA LOCAL INFILE SQL statement and execute it. However this seems to be rare, and has a fairly simple workaround: switch to MySqlBulkLoader. We could also relax the "path must start with MySqlBulkLoader.StreamPrefix" requirement if SslMode is VerifyCA (or higher), as that implies we can trust the server; if we did that, another workaround would be to use a SSL certificate to connect to the server.
The text was updated successfully, but these errors were encountered:
A malicious server could respond with
0xFB C:\local\filename.ext
to anyCOM_QUERY
request, and MySqlConnector would transmit that file to the server. See https://dev.mysql.com/doc/refman/5.7/en/load-data-local.html for a full description.The simplest mitigation would be to obfuscate all source file names in
MySqlBulkLoader.LoadAsync
; that is, if a file name is specified, open it for reading then treat it as aSourceStream
. InResultSet.ReadResultSetHeaderAsync
, only allow "file names" that begin withMySqlBulkLoader.StreamPrefix
. This would prohibit arbitrary filesystem paths from being requested.This would break clients who manually construct a
LOAD DATA LOCAL INFILE
SQL statement and execute it. However this seems to be rare, and has a fairly simple workaround: switch toMySqlBulkLoader
. We could also relax the "path must start withMySqlBulkLoader.StreamPrefix
" requirement ifSslMode
is VerifyCA (or higher), as that implies we can trust the server; if we did that, another workaround would be to use a SSL certificate to connect to the server.The text was updated successfully, but these errors were encountered: