diff --git a/src/metabase/driver/h2.clj b/src/metabase/driver/h2.clj index 68822edeee7589ea418a524f776b3ce1824d0c80..6f7984ed9343644a930748b76e772d14c927a1b8 100644 --- a/src/metabase/driver/h2.clj +++ b/src/metabase/driver/h2.clj @@ -366,8 +366,14 @@ [connection-string] {:pre [(string? connection-string)]} (let [[file options] (connection-string->file+options connection-string)] - (file+options->connection-string file (merge options {"IFEXISTS" "TRUE" - "ACCESS_MODE_DATA" "r"})))) + (file+options->connection-string file (merge + (->> options + ;; Remove INIT=... from options for security reasons (Metaboat #165) + ;; http://h2database.com/html/features.html#execute_sql_on_connection + (remove (fn [[k _]] (= (str/lower-case k) "init"))) + (into {})) + {"IFEXISTS" "TRUE" + "ACCESS_MODE_DATA" "r"})))) (defmethod sql-jdbc.conn/connection-details->spec :h2 [_ details]