-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
mini-browser, webview: warn if unsecure #9563
Conversation
a307f85
to
67818e6
Compare
67818e6
to
9635952
Compare
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.
I confirmed that the changes work as intended 👍
- confirmed that the preference
webview.warnIfUnsecure
works correctly when the webview environment isunsecure
- selecting 'do not show again' updates the preference. - confirmed that the preference
mini-browser.warnIfUnsecure
works correctly when the environment formini-browser
isunsecure
- selecting 'do not show again' updates the preference. - confirmed that
mini-browser.previewFile.preventUnsecure
works correctly:ask
: prompts to choose which action to perform (confirmed they all work as intended).alwaysOpen
: opens the resource always.alwaysPrevent
: prevents opening the resource - notification is displayed when preventing.
- confirmed that setting the application property
securityWarnings
tofalse
removes all functionality checks.
At the moment electron
also complains like browser
is it the intention to also check the environment for electron
?
Do you mean if one sets the environment variable to insecure mode, the Electron version of Theia apps will respect it? In that case, it might be good to have the warning for Electron too, when it applies. |
@vince-fugnitto I mean even in the electron target if the environment is unescure for either webviews and mini-browser it will warn users which I think might be good, just wanted to confirm 👍 The functionality is on by default for both |
So long as the warning is valid, I see no problem. For example, if the environment variable were not used for Electron and a secure setup was done no matter what, there would be no need to warn if the environment variables were set to an insecure value. |
Let's do that actually, will update this PR with a commit for this. |
67f0b1e
to
56ee98c
Compare
56ee98c
to
1755e26
Compare
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.
I confirmed that the changes work as intended:
- confirmed that the preference
webview.warnIfUnsecure
works correctly when the webview environment is unsecure - selecting 'do not show again' updates the preference. - confirmed that the preference
mini-browser.warnIfUnsecure
works correctly when the environment for mini-browser is unsecure - selecting 'do not show again' updates the preference. - confirmed that
mini-browser.previewFile.preventUnsecure
works correctly:ask
: prompts to choose which action to perform:Open
: opens the resourceAlways Open
: sets the preference toalwaysOpen
and opens the resourcePrevents
: prevents opening the resourceAlways Prevent
: sets the preferencealwaysPrevent
and prevents opening the resource
alwaysOpen
: opens the resource always.alwaysPrevent
: prevents opening the resource - notification is displayed when preventing.
- confirmed that setting the application property
securityWarnings
to false removes all functionality checks. - confirmed that no notifications are present for electron as it is secure.
Open: successfully opens the preview
b651bab
to
59f82ad
Compare
@marcdumais-work @vince-fugnitto I updated this PR to be simpler. It will just prompt a warning whenever someone changes the host patterns to something different from the default, like suggested by @marcdumais-work . The warnings point to READMEs with instructions on how to turn it off. @eclipse-theia/core is the change in its current form acceptable for everyone? |
98a91f1
to
a073736
Compare
Add security warnings to the mini-browser and webviews when modifying the host patterns. You can disable those warnings by setting `warnOnPotentiallyInsecureHostPattern: false` in your application's `package.json` file, as frontend/backend configurations.
a073736
to
fe06912
Compare
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.
I confirmed that the latest updates work correctly 👍
- there are no errors when the environment is secure.
- a notification appears when the
mini-browser
environment is unsecure, and a message is logged on the backend (THEIA_MINI_BROWSER_EXTERNAL_ENDPOINT={{hostname}}
)ok
dismisses the notification.go to readme
opens the documentation formini-browser
.
- a notification appears when the
webview
environment is unsecure, and a message is logged on the backend (THEIA_WEBVIEW_EXTERNAL_ENDPOINT={{hostname}}
)ok
dismisses the notification.go to readme
opens the documentation formini-browser
.
- the warnings are suppressed if
warnOnPotentiallyInsecureHostPattern
is set tofalse
in the application's config (package.json).
@vince-fugnitto @paul-marechal Are we good to merge this, before the release? |
Add security warnings to the mini-browser and webviews when modifying
the host patterns. You can disable those warnings by setting
warnOnPotentiallyInsecureHostPattern: false
in your application'spackage.json
file, as frontend/backend configurations.How to test
THEIA_WEBVIEW_EXTERNAL_ENDPOINT={{hostname}}
and run the example applications:THEIA_MINI_BROWSER_HOST_PATTERN={{hostname}}
and run the example applications:package.json
file to set the frontend/backend config'swarnOnPotentiallyInsecureHostPattern: false
:Review checklist
Reminder for reviewers