Skip to content

Commit

Permalink
Merge pull request #1181 from oasisprotocol/lw/disable-spellcheck
Browse files Browse the repository at this point in the history
Disable spellcheck in sensitive inputs
  • Loading branch information
lukaw3d committed Dec 2, 2022
2 parents 32fd270 + 6db412c commit 1109cba
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/app/lib/preventSavingInputsToUserData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* Browsers write visible input fields from any website to user data to enable
* restoring sessions. Browsers exclude inputs with autocomplete="off" from
* cached form data in the session history (even though they ignore it and still
* offer autofill from saved passwords).
* offer autofill from saved passwords). Browsers with enhanced spellcheck also
* send it to the cloud.
*
* To ensure this fixes vulnerability:
* - Manually checked
Expand All @@ -17,5 +18,11 @@
* - https://coinyuppie.com/slow-mist-a-brief-analysis-of-the-metamask-wallet-demonic-vulnerability/
* - https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
* - https://nvd.nist.gov/vuln/detail/CVE-2022-0167
* - https://www.otto-js.com/news/article/spell-jacking-enhanced-spellcheck-features-send-pii-even-passwords
*/
export const preventSavingInputsToUserData = { autoComplete: 'off' }
export const preventSavingInputsToUserData = {
autoComplete: 'off',
autoCapitalize: 'off',
autoCorrect: 'off',
spellCheck: false,
}
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ exports[`<FromMnemonic/> should match snapshot 1`] = `
class="c2"
>
<form
autocapitalize="off"
autocomplete="off"
autocorrect="off"
spellcheck="false"
>
<h1
class="c3"
Expand All @@ -424,11 +427,14 @@ exports[`<FromMnemonic/> should match snapshot 1`] = `
class="c6 "
>
<textarea
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="c7"
id="mnemonic"
placeholder="openWallet.mnemonic.enterPhraseHere"
rows="5"
spellcheck="false"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,10 @@ exports[`<FromPrivateKey /> should match snapshot 1`] = `
class="c1"
>
<form
autocapitalize="off"
autocomplete="off"
autocorrect="off"
spellcheck="false"
>
<h1
class="c2"
Expand Down Expand Up @@ -472,11 +475,14 @@ exports[`<FromPrivateKey /> should match snapshot 1`] = `
class="c8"
>
<input
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="c9"
id="privatekey"
name="privateKey"
placeholder="openWallet.privateKey.enterPrivateKeyHere"
spellcheck="false"
type="password"
value=""
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,10 @@ exports[`<ImportAccountsSelectionModal /> should match snapshot 1`] = `
/>
<div>
<form
autocapitalize="off"
autocomplete="off"
autocorrect="off"
spellcheck="false"
>
<div
class="c5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ exports[`<TransactionRecipient /> should render component 1`] = `
class="c4"
>
<form
autocapitalize="off"
autocomplete="off"
autocorrect="off"
spellcheck="false"
style="width: 465px;"
>
<div
Expand Down

0 comments on commit 1109cba

Please sign in to comment.