MySQL allows loading local data Affecting Cloud SQL service in Google


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Data/ Access

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-GoogleGDPRHIPAAISO-27001SOC-2
  • Snyk IDSNYK-CC-00361
  • creditSnyk Research Team

Description

The MySQL database instance 'local_infile' flag controls server-side LOCAL capabilities for LOAD DATA statements. If permitted, clients can perform local data loading, which can be a security risk.

How to fix?

Set settings.database_flags.name attribute to "local_infile", and settings.database_flags.value attribute to "off".

Example Configuration

resource "google_sql_database_instance" "allowed" {
  name             = "master-instance"
  database_version = "MYSQL_5_6"
  region           = "us-central1"

  settings {
    tier = "db-f1-micro"
    database_flags {
      name  = "local_infile"
      value = "off"
    }
  }
}