diff --git a/phpBB/phpbb/config/db.php b/phpBB/phpbb/config/db.php
index 4efe0d2810..5c20bb5ec9 100644
--- a/phpBB/phpbb/config/db.php
+++ b/phpBB/phpbb/config/db.php
@@ -170,8 +170,8 @@ class db extends config
 		if (!isset($this->config[$key]))
 		{
 			$sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array(
-				'config_name'	=> $key,
-				'config_value'	=> $new_value,
+				'config_name'	=> $this->db->sql_escape($key),
+				'config_value'	=> $this->db->sql_escape($new_value),
 				'is_dynamic'	=> ($use_cache) ? 0 : 1));
 			$this->db->sql_query($sql);
 		}
diff --git a/phpBB/phpbb/db/migration/data/v33x/google_recaptcha_v3.php b/phpBB/phpbb/db/migration/data/v33x/google_recaptcha_v3.php
index 65499cc402..1d5ec6233f 100644
--- a/phpBB/phpbb/db/migration/data/v33x/google_recaptcha_v3.php
+++ b/phpBB/phpbb/db/migration/data/v33x/google_recaptcha_v3.php
@@ -38,7 +38,7 @@ class google_recaptcha_v3 extends \phpbb\db\migration\migration
 
 		foreach (\phpbb\captcha\plugins\recaptcha_v3::get_actions() as $action)
 		{
-			$data[] = ['config.add', ["recaptcha_v3_threshold_{$action}", 0.5]];
+			$data[] = ['config.add', ["recaptcha_v3_threshold_{$action}", '0.5']];
 		}
 
 		return $data;