-
Notifications
You must be signed in to change notification settings - Fork 932
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address Bar Spoofing Test Cases + Remediation (#3882)
- Loading branch information
1 parent
2a9e0bb
commit ce56966
Showing
10 changed files
with
318 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
.maestro/security_tests/1_-_AddressBarSpoof,_basicauth.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
appId: com.duckduckgo.mobile.android | ||
tags: | ||
- securityTest | ||
--- | ||
- launchApp: | ||
clearState: true | ||
- runFlow: ../shared/onboarding.yaml | ||
- doubleTapOn: | ||
id: "omnibarTextInput" | ||
- pressKey: Backspace | ||
# Test 1 - using \u2028 character | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-basicauth-2028.html" | ||
- pressKey: Enter | ||
- tapOn: "Got It" | ||
- tapOn: "run" | ||
- assertVisible: "Example Domain" | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText.indexOf("https://www.google.com") != 0} | ||
- tapOn: | ||
id: "omnibarTextInput" | ||
# Test 2 - using \u2029 character | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-basicauth-2029.html" | ||
- pressKey: Enter | ||
- tapOn: "run" | ||
- assertVisible: "Example Domain" | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText.indexOf("https://www.google.com") != 0} | ||
- tapOn: | ||
id: "omnibarTextInput" | ||
# Test 3 - using repeated " " space character | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-basicauth-whitespace.html" | ||
- pressKey: Enter | ||
- tapOn: "run" | ||
- assertVisible: "Example Domain" | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText.indexOf("https://www.google.com") != 0} | ||
- tapOn: | ||
id: "omnibarTextInput" |
21 changes: 21 additions & 0 deletions
21
.maestro/security_tests/2_-_AddressBarSpoof,_aboutblank.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
appId: com.duckduckgo.mobile.android | ||
tags: | ||
- securityTest | ||
--- | ||
- launchApp: | ||
clearState: true | ||
- runFlow: ../shared/onboarding.yaml | ||
- doubleTapOn: | ||
id: "omnibarTextInput" | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-about-blank-rewrite.html" | ||
- pressKey: Enter | ||
- tapOn: "Got It" | ||
- tapOn: "Start" | ||
# This test is expected to load "about:blank" then duckduckgo.com, not remain on the current page with spoofed content. | ||
- extendedWaitUntil: | ||
notVisible: "Not DDG." # Spoofed content not visible | ||
timeout: 10000 | ||
- tapOn: "Phew!" | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText == "about:blank" || maestro.copiedText == "https://duckduckgo.com/"} |
30 changes: 30 additions & 0 deletions
30
.maestro/security_tests/3_-_AddressBarSpoof,_appschemes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
appId: com.duckduckgo.mobile.android | ||
tags: | ||
- securityTest | ||
--- | ||
- launchApp: | ||
clearState: true | ||
- runFlow: ../shared/onboarding.yaml | ||
# Test 1 | ||
- doubleTapOn: | ||
id: "omnibarTextInput" | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-application-scheme.html" | ||
- pressKey: Enter | ||
- tapOn: "Got It" | ||
- tapOn: "Start" | ||
- tapOn: "Phew!" | ||
# This test should reject trying to load | ||
# This test is expected to load duckduckgo.com, not remain on the current page with spoofed content. | ||
- assertVisible: "Privacy, simplified." # DuckDuckGo home page | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText == "https://duckduckgo.com/"} # DuckDuckGo home page | ||
- tapOn: | ||
id: "omnibarTextInput" | ||
# Test 2 | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-unsupported-scheme.html" | ||
- pressKey: Enter | ||
- tapOn: "Start" | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText == "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-unsupported-scheme.html"} |
20 changes: 20 additions & 0 deletions
20
.maestro/security_tests/4_-_AddressBarSpoof,_b64_html.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
appId: com.duckduckgo.mobile.android | ||
tags: | ||
- securityTest | ||
--- | ||
- launchApp: | ||
clearState: true | ||
- runFlow: ../shared/onboarding.yaml | ||
# Test 1 | ||
- doubleTapOn: | ||
id: "omnibarTextInput" | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-open-b64-html.html" | ||
- pressKey: Enter | ||
- tapOn: "Got It" | ||
- tapOn: "Start" | ||
# This test is expected to open a new tab with empty origin ("") and then prompt to open the link in another app | ||
- assertVisible: "Open in another app" | ||
- tapOn: "Cancel" | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText.indexOf("duckduckgo.com") == -1} |
33 changes: 33 additions & 0 deletions
33
.maestro/security_tests/5_-_AddressBarSpoof,_downloadpath.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
appId: com.duckduckgo.mobile.android | ||
tags: | ||
- securityTest | ||
--- | ||
- launchApp: | ||
clearState: true | ||
- runFlow: ../shared/onboarding.yaml | ||
# Test 1 | ||
- doubleTapOn: | ||
id: "omnibarTextInput" | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-js-download-url.html" | ||
- pressKey: Enter | ||
- tapOn: "Got It" | ||
- tapOn: "Start" | ||
# Download Acceptance Flow: | ||
- extendedWaitUntil: | ||
visible: "Save to Downloads" | ||
timeout: 10000 | ||
- tapOn: "Save to Downloads" | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText == "Search or type URL"} # Downloads should occur in empty origin. | ||
- pressKey: Back | ||
# Download Cancel Flow: | ||
- tapOn: "Start" | ||
- extendedWaitUntil: | ||
visible: "Cancel" | ||
timeout: 10000 | ||
- tapOn: "Cancel" | ||
# Should redirect back to the last page. | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText == "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-js-download-url.html"} |
18 changes: 18 additions & 0 deletions
18
.maestro/security_tests/6_-_AddressBarSpoof,_formaction.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
appId: com.duckduckgo.mobile.android | ||
tags: | ||
- securityTest | ||
--- | ||
- launchApp: | ||
clearState: true | ||
- runFlow: ../shared/onboarding.yaml | ||
# Test 1 | ||
- doubleTapOn: | ||
id: "omnibarTextInput" | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-form-action.html" | ||
- pressKey: Enter | ||
- tapOn: "Got It" | ||
- tapOn: "run" | ||
# Should do nothing - the navigation should be prevented. | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText == "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-form-action.html"} |
19 changes: 19 additions & 0 deletions
19
.maestro/security_tests/7_-_AddressBarSpoof,_pagerewrite.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
appId: com.duckduckgo.mobile.android | ||
tags: | ||
- securityTest | ||
--- | ||
- launchApp: | ||
clearState: true | ||
- runFlow: ../shared/onboarding.yaml | ||
# Test 1 | ||
- doubleTapOn: | ||
id: "omnibarTextInput" | ||
- inputText: "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-js-page-rewrite.html" | ||
- pressKey: Enter | ||
- tapOn: "Got It" | ||
- tapOn: "Start" | ||
# Now check the address bar hasn't been updated too early resulting in spoofed content | ||
- copyTextFrom: | ||
id: "omnibarTextInput" | ||
- assertTrue: ${maestro.copiedText == "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-js-page-rewrite.html"} | ||
- assertNotVisible: "DDG." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters