-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address Bar Spoofing Test Cases + Remediation #3882
Conversation
app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
Outdated
Show resolved
Hide resolved
Add test case for valid URL containing "@" character.
app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
Outdated
Show resolved
Hide resolved
Are the maestro test executed at all? If they are not part of any workflows they will never run. |
- Account for the port string as well.
Thanks for taking a look folks. @marcosholgado - I’ve added these to run at the same intervals as Privacy Tests. Do we think this is a reasonable choice? In addition to these I’ve added some fairly extensive unit tests for expected success and failure cases of basic auth extraction. Please let me know if you spot any cases that are missing. |
app/src/androidTest/java/com/duckduckgo/app/browser/BrowserTabViewModelTest.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it seems to be working as expected. However, the Maestro tests aren't passing and I had a few other issues that should be addressed before we can merge.
* Add error handling to stripBasicAuthFromUrl() and make private * Add tests for exception throwing cases * Remove 0_all.yaml and add onboarding step to each test individually
Thanks @joshliebe - I've made some changes as you requested and got the maestro tests passing: https://github.com/duckduckgo/Android/actions/runs/7126639716 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks 👍
Task/Issue URL: https://app.asana.com/0/0/1205916690837650/f
Description
The browser implementation of the address bar updating functionality is currently vulnerable to an Address Bar Spoofing vulnerability. In this PR I integrate all of our known address bar spoofing tests, including a fix for the basic auth address bar spoofing issues where someone can hide the domain portion of the address bar by prepending fake basic auth credentials to the domain.
In the fix, I simply strip the username/password fields from the address bar which forces the browser to prompt for username/password. This is consistent with our other browser implementations on macOS and iOS.
Steps to test this PR
Security Tests
maestro test .maestro/security_tests/0_all.yaml
Basic Auth
Primary Questions: