mysql2 icon indicating copy to clipboard operation
mysql2 copied to clipboard

MySQL2 LOCAL INFILE should be disabled by default.

Open thypon opened this issue 4 years ago • 1 comments

MySQL LOCAL INFILE has been leveraged to perform file exfiltration in the past.

Official documentation advise to disable this capability unless it is explicitly enabled.

To avoid LOAD DATA issues, clients should avoid using LOCAL unless proper client-side precautions have been taken.

May you consider disabling LOCAL INFILE by default in future mysql2 releases?

Following the affected code that in null-y case will default to 1 (enabled)

    case MYSQL_OPT_LOCAL_INFILE:
      intval = (value == Qfalse ? 0 : 1);
      retval = &intval;
      break;

thypon avatar Jul 07 '20 13:07 thypon

Seems reasonable. I'll target this for the next major since it would be a breaking change to current users.

sodabrew avatar Jul 07 '20 13:07 sodabrew