mini-browser, webview: warn if unsecure#9563
Conversation
a307f85 to
67818e6
Compare
67818e6 to
9635952
Compare
vince-fugnitto
left a comment
There was a problem hiding this comment.
I confirmed that the changes work as intended 👍
- confirmed that the preference
webview.warnIfUnsecureworks correctly when the webview environment isunsecure- selecting 'do not show again' updates the preference. - confirmed that the preference
mini-browser.warnIfUnsecureworks correctly when the environment formini-browserisunsecure- selecting 'do not show again' updates the preference. - confirmed that
mini-browser.previewFile.preventUnsecureworks 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
securityWarningstofalseremoves 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.
I confirmed that the changes work as intended:
- confirmed that the preference
webview.warnIfUnsecureworks correctly when the webview environment is unsecure - selecting 'do not show again' updates the preference. - confirmed that the preference
mini-browser.warnIfUnsecureworks correctly when the environment for mini-browser is unsecure - selecting 'do not show again' updates the preference. - confirmed that
mini-browser.previewFile.preventUnsecureworks correctly:ask: prompts to choose which action to perform:Open: opens the resourceAlways Open: sets the preference toalwaysOpenand opens the resourcePrevents: prevents opening the resourceAlways Prevent: sets the preferencealwaysPreventand 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
securityWarningsto 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
vince-fugnitto
left a comment
There was a problem hiding this comment.
I confirmed that the latest updates work correctly 👍
- there are no errors when the environment is secure.
- a notification appears when the
mini-browserenvironment is unsecure, and a message is logged on the backend (THEIA_MINI_BROWSER_EXTERNAL_ENDPOINT={{hostname}})okdismisses the notification.go to readmeopens the documentation formini-browser.
- a notification appears when the
webviewenvironment is unsecure, and a message is logged on the backend (THEIA_WEBVIEW_EXTERNAL_ENDPOINT={{hostname}})okdismisses the notification.go to readmeopens the documentation formini-browser.
- the warnings are suppressed if
warnOnPotentiallyInsecureHostPatternis set tofalsein 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: falsein your application'spackage.jsonfile, 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.jsonfile to set the frontend/backend config'swarnOnPotentiallyInsecureHostPattern: false:Review checklist
Reminder for reviewers