fix(android): Add mitigation strategy for CVE-2020-6506 #792
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Platforms affected
Android
Motivation and Context
These changes mitigate the security vulnerability (CVE-2020-6506) recently found in Chromium that affects the Android WebView prior to version 83.0.4103.106.
See: https://cordova.apache.org/news/2020/09/29/cve-2020-6506.html
See: https://alesandroortiz.com/articles/uxss-android-webview-cve-2020-6506/
See: https://bugs.chromium.org/p/chromium/issues/detail?id=1083819
Description
This mitigation strategy works by enabling the flag to handle multiple windows in the InAppBrowser plugin. When a new window event occurs, the plugin attempts to load the target in a temporary WebView. If the URL is clean it will be passed back to the original InAppBrowser WebView to mimic the original single-window behavior. This filters out Javascript (and thus any malicious code).
Testing
This mitigation was tested using proof-of-concept pages provided by the security researcher who discovered the vulnerability (Alesandro Ortiz) linked here: https://alesandroortiz.com/security/chromiumwebview/cve-2020-6506.html
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)