[CONC-206] Disallow LOAD DATA LOCAL INFILE Created: 2016-10-03  Updated: 2021-02-08

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Critical
Reporter: Anders Karlsson Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by CONC-515 Implement safe LOAD DATA LOCAL INFILE... In Review

 Description   

A customer reports that https://dev.mysql.com/doc/mysql-security-excerpt/5.1/en/load-data-local.html is critical. This issue is arouind a compromised MariaDB Server and through that getting access to client local files. As the issue is around a patched / compromised server, this issue has to be handled on the client side. The idea here is to have a configuration parameter that would disallow the MariaDB Connector to respond to requests for client local files.



 Comments   
Comment by Georg Richter [ 2016-10-04 ]

Connector/C has 2 options for LOAD DATA LOCAL INFILE

1) Disallow LOAD DATA LOCAL INFILE in general:

mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, &onoff);

2nd) Callback handler to verify the filename (was added in C/C 2.3.0).
If the server sends request to client to send a file, the client will check via callback if the filename matches with filename in the previously sent statement.

int verify_local_infile_callback(void *data, const char *filename)
{
  char *orig_filename= (char *)data;
  return strcmp(filename, orig_filename);
}
..
 
strcpy(orig_file, "onlythisfile_isallowed.csv");
mysql_optionsv(mysql, MARIADB_OPT_VERIFY_LOCAL_INFILE_CALLBACK, verify_local_infile_callback, (void *)orig_file);

Comment by Anders Karlsson [ 2016-10-04 ]

Yes, this is relevant. I think what the customer was asking for though was something more general, non-application dependent.

Generated at Thu Feb 08 03:03:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.