Skip to content

Commit c062d18

Browse files
authored
Merge pull request #241 from /issues/234
#234: Auto-fill browser functionality can override API keys for reCAPCTH and block Admin Panel access
2 parents 71d9c41 + 16c0bc0 commit c062d18

File tree

6 files changed

+39
-6
lines changed

6 files changed

+39
-6
lines changed

ReCaptchaVersion2Checkbox/etc/adminhtml/system.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
18
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
29
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
310
<system>
@@ -6,9 +13,10 @@
613
showInStore="0">
714
<label>reCAPTCHA v2 ("I am not a robot")</label>
815

9-
<field id="public_key" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0"
16+
<field id="public_key" translate="label" type="obscure" sortOrder="10" showInDefault="1" showInWebsite="0"
1017
showInStore="0" canRestore="0">
1118
<label>Google API Website Key</label>
19+
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
1220
</field>
1321

1422
<field id="private_key" translate="label" type="obscure" sortOrder="20" showInDefault="1" showInWebsite="0"
@@ -49,9 +57,10 @@
4957
showInStore="1">
5058
<label>reCAPTCHA v2 ("I am not a robot")</label>
5159

52-
<field id="public_key" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1"
60+
<field id="public_key" translate="label" type="obscure" sortOrder="10" showInDefault="1" showInWebsite="1"
5361
showInStore="0" canRestore="0">
5462
<label>Google API Website Key</label>
63+
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
5564
</field>
5665

5766
<field id="private_key" translate="label" type="obscure" sortOrder="20" showInDefault="1" showInWebsite="1"

ReCaptchaVersion2Checkbox/etc/config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<default>
1111
<recaptcha_backend>
1212
<type_recaptcha>
13+
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
1314
<private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
1415
<size>normal</size>
1516
<theme>light</theme>
@@ -19,6 +20,7 @@
1920
</recaptcha_backend>
2021
<recaptcha_frontend>
2122
<type_recaptcha>
23+
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
2224
<private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
2325
<size>normal</size>
2426
<theme>light</theme>

ReCaptchaVersion2Invisible/etc/adminhtml/system.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
18
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
29
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
310
<system>
@@ -6,9 +13,10 @@
613
showInStore="0">
714
<label>reCAPTCHA v2 Invisible</label>
815

9-
<field id="public_key" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0"
16+
<field id="public_key" translate="label" type="obscure" sortOrder="10" showInDefault="1" showInWebsite="0"
1017
showInStore="0" canRestore="0">
1118
<label>Google API Website Key</label>
19+
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
1220
</field>
1321

1422
<field id="private_key" translate="label" type="obscure" sortOrder="20" showInDefault="1" showInWebsite="0"
@@ -49,9 +57,10 @@
4957
showInStore="1">
5058
<label>reCAPTCHA v2 Invisible</label>
5159

52-
<field id="public_key" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1"
60+
<field id="public_key" translate="label" type="obscure" sortOrder="10" showInDefault="1" showInWebsite="1"
5361
showInStore="0" canRestore="0">
5462
<label>Google API Website Key</label>
63+
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
5564
</field>
5665

5766
<field id="private_key" translate="label" type="obscure" sortOrder="20" showInDefault="1" showInWebsite="1"

ReCaptchaVersion2Invisible/etc/config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<default>
1111
<recaptcha_backend>
1212
<type_invisible>
13+
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
1314
<private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
1415
<position>inline</position>
1516
<theme>light</theme>
@@ -19,6 +20,7 @@
1920
</recaptcha_backend>
2021
<recaptcha_frontend>
2122
<type_invisible>
23+
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
2224
<private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
2325
<position>inline</position>
2426
<theme>light</theme>

ReCaptchaVersion3Invisible/etc/adminhtml/system.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
18
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
29
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
310
<system>
@@ -6,9 +13,10 @@
613
showInStore="0">
714
<label>reCAPTCHA v3 Invisible</label>
815

9-
<field id="public_key" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0"
16+
<field id="public_key" translate="label" type="obscure" sortOrder="10" showInDefault="1" showInWebsite="0"
1017
showInStore="0" canRestore="0">
1118
<label>Google API Website Key</label>
19+
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
1220
</field>
1321

1422
<field id="private_key" translate="label" type="obscure" sortOrder="20" showInDefault="1" showInWebsite="0"
@@ -59,9 +67,10 @@
5967
showInStore="1">
6068
<label>reCAPTCHA v3 Invisible</label>
6169

62-
<field id="public_key" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1"
70+
<field id="public_key" translate="label" type="obscure" sortOrder="10" showInDefault="1" showInWebsite="1"
6371
showInStore="0" canRestore="0">
6472
<label>Google API Website Key</label>
73+
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
6574
</field>
6675

6776
<field id="private_key" translate="label" type="obscure" sortOrder="20" showInDefault="1" showInWebsite="1"

ReCaptchaVersion3Invisible/etc/config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<default>
1111
<recaptcha_backend>
1212
<type_recaptcha_v3>
13+
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
1314
<private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
1415
<score_threshold>0.5</score_threshold>
1516
<position>inline</position>
@@ -20,6 +21,7 @@
2021
</recaptcha_backend>
2122
<recaptcha_frontend>
2223
<type_recaptcha_v3>
24+
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
2325
<private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
2426
<score_threshold>0.5</score_threshold>
2527
<position>inline</position>

0 commit comments

Comments
 (0)