From 26619e28cc7c2fbea89380cd1d30ab93751700be Mon Sep 17 00:00:00 2001 From: Jack Clancy Date: Wed, 10 Jan 2018 00:17:52 -0500 Subject: [PATCH] Enforce HTTPS / Prevent Reverse Tabnabbing (#773) * working version of test custom rule config * setting no imports to false so tests will pass * adding anchor blank noopener rule, rule currently off to allow tests to pass * removing copied code from tslint-microsoft-contrib * adding tslint-microsoft-contrib to dev deps * extending tslint for external http rule * locking tslint-microsoft-contrib version and turning on target blank noopener rule * final fixes for pull #663 * add noopener noreferrer as needed * fixing false positives for a tags without href * really fix linting errors * fix imports * remove accidently(?) added LedgerNano duplicate file --- .../components/BalanceSidebar/AccountInfo.tsx | 12 ++- common/components/BalanceSidebar/Promos.tsx | 1 + common/components/ErrorScreen/index.tsx | 2 +- .../TransactionSucceeded.tsx | 7 +- .../Header/components/GasPriceDropdown.tsx | 6 +- .../Header/components/NavigationLink.tsx | 8 +- .../components/DeterministicWalletsModal.tsx | 10 +- .../WalletDecrypt/components/LedgerNano.tsx | 10 +- .../WalletDecrypt/components/Mnemonic.tsx | 2 +- .../WalletDecrypt/components/Trezor.tsx | 6 +- common/components/ui/Help.tsx | 2 +- common/components/ui/NewTabLink.tsx | 2 +- common/containers/Tabs/Help/index.tsx | 3 +- .../Tabs/Swap/components/BitcoinQR.tsx | 2 +- .../Tabs/Swap/components/CurrentRates.tsx | 7 +- .../Swap/components/SwapInfoHeaderTitle.tsx | 7 +- .../Tabs/Swap/components/SwapProgress.tsx | 4 +- common/index.html | 8 +- .../noExternalHttpLinkRule.js | 95 ++++++++++++++++++ .../noExternalHttpLinkRule.ts | 96 +++++++++++++++++++ package.json | 1 + tslint.json | 6 +- 22 files changed, 266 insertions(+), 31 deletions(-) create mode 100644 custom_linting_rules/noExternalHttpLinkRule.js create mode 100644 custom_linting_rules/noExternalHttpLinkRule.ts diff --git a/common/components/BalanceSidebar/AccountInfo.tsx b/common/components/BalanceSidebar/AccountInfo.tsx index 074a2188..e363b4e3 100644 --- a/common/components/BalanceSidebar/AccountInfo.tsx +++ b/common/components/BalanceSidebar/AccountInfo.tsx @@ -93,14 +93,22 @@ export default class AccountInfo extends React.Component {