sandboxie-plus / Sandboxie

Sandboxie Plus & Classic
https://Sandboxie-Plus.com
GNU General Public License v3.0
13.13k stars 1.46k forks source link

Microsoft Edge stops working whenever there is a pending update and needs to be restarted #3330

Open qazero opened 10 months ago

qazero commented 10 months ago

Describe what you noticed and did

Sandboxie: 5.662 64 bit

Microsoft Edge: 117.0.2045.43 (Official build) (64-bit) Revision: fe8879882c1b3f88d70d7eee3124f6773ecdb5cc Chromium version: 117.0.5938.92 Operating system: Windows 10 Version 22H2 (Build 19045.3448)

I usually leave my computer running 24/7 with sever tabs open in Microsoft Edge. However, sometimes when I come back to the computer after a few hours I notice that when I try to navigate to a new website nothing loads. It doesn't return an error either, it just seems to do nothing when I type in a website and press enter. The tabs which I had open previously remain working just fine but if I try navigating to a new page it doesn't load either. Finally all extensions stop working as well. Also, sometimes when I return to the computer after a few hours the web browser is all blacked out and I can't see or click on anything.

It seems that this happens every few days whenever there is a new update pending for Microsoft Edge which requires me to restart the web browser. This is pretty inconvenient especially when I have sever tabs open and logged in to various websites. I never had this issue on Google Chrome but seems to be an issue only on Microsoft Edge. Any ideas?

How often did you encounter it so far?

Every few days whenever there's a new update pending for Microsoft Edge

Affected program

Microsoft Edge: 117.0.2045.43 (Official build) (64-bit)

Download link

N.A.

Where is the program located?

The program is installed only outside the sandbox.

Expected behavior

Microsoft Edge shouldn't stop working or black out unexpectedly whenever there is an update pending.

What is your Windows edition and version?

Windows 10 Version 22H2 (Build 19045.3448) 64bit

In which Windows account you have this problem?

A local account (Administrator).

Please mention any installed security software

Kaspersky (Edge extension uninstalled)

What version of Sandboxie are you running?

5.662 64 bit

Is it a new installation of Sandboxie?

I recently did a new clean installation.

Is it a regression?

Issue has been present for at least 4-6 months

In which sandbox type you have this problem?

I only reproduced it with Sandboxie Classic.

Can you reproduce this problem on a new empty sandbox?

I can confirm it also on a new empty sandbox.

Did you previously enable some security policy settings outside Sandboxie?

N.A.

Crash dump

No response

Trace log

No response

Sandboxie.ini configuration

[GlobalSettings]

Template=Proxifier
Template=Edge_Fix
Template=Edge_Win11Fix
Template=RpcPortBindings
Template=Windows10CoreUI
Template=FireFix_for_Win7
Template=Kaspersky
Template=InternetDownloadManager
Template=AdobeDistiller
Template=Avira_Antivirus
Template=KeyScrambler
Template=WindowsRasMan
Template=WindowsLive
Template=OfficeLicensing
Template=OfficeClickToRun
ActivationPrompt=n
ClosedFilePath=*\Windows.System.Launcher.dll
SpecialImage=firefox,brave.exe

[DefaultBox]

ConfigLevel=10
AutoRecover=y
BlockNetworkFiles=y
Template=Edge_Force
Template=Brave_Force
Template=OpenSmartCard
Template=OpenBluetooth
Template=SkipHook
Template=FileCopy
Template=Firefox_Force
Template=Chrome_Force
Template=IExplore_Favorites_RecoverFolder
Template=IExplore_Force
Template=qWave
Template=BlockPorts
Template=LingerPrograms
Template=Chrome_Phishing_DirectAccess
Template=Firefox_Phishing_DirectAccess
Template=AutoRecoverIgnore
RecoverFolder=%{374DE290-123F-4565-9164-39C4925E467B}%
RecoverFolder=%Desktop%
BorderColor=#00FFFF,off
Enabled=y
BoxNameTitle=-
AutoDelete=y
NeverDelete=n
ForceProcess=microsoftedge.exe

[UserSettings_08DA01C0]

SbieCtrl_UserName=user
SbieCtrl_NextUpdateCheck=1696105846
SbieCtrl_UpdateCheckNotify=n
SbieCtrl_ShowWelcome=n
SbieCtrl_WindowCoords=-2668,221,2475,1265
SbieCtrl_ActiveView=40021
SbieCtrl_AutoApplySettings=y
SbieCtrl_SettingChangeNotify=n
SbieCtrl_HideWindowNotify=n
SbieCtrl_HideMessage=2224,msedge.exe [DefaultBox]
SbieCtrl_HideMessage=2308,[41 / C0000024]
SbieCtrl_HideMessage=2335
SbieCtrl_HideMessage=2335,plugins_nms.exe [3
SbieCtrl_HideMessage=2335,plugins_nms.exe [33 / 5]
SbieCtrl_HideMessage=1320,[19748]
SbieCtrl_HideMessage=1319,[19748]
SbieCtrl_ProcessViewColumnWidths=250,70,300
SbieCtrl_BoxExpandedView=DefaultBox,Test

[Test]

Enabled=y
ConfigLevel=10
AutoRecover=y
BlockNetworkFiles=y
Template=OpenSmartCard
Template=OpenBluetooth
Template=SkipHook
Template=FileCopy
Template=qWave
Template=BlockPorts
Template=LingerPrograms
Template=Chrome_Phishing_DirectAccess
Template=Firefox_Phishing_DirectAccess
Template=AutoRecoverIgnore
RecoverFolder=%{374DE290-123F-4565-9164-39C4925E467B}%
RecoverFolder=%Personal%
RecoverFolder=%Favorites%
RecoverFolder=%Desktop%
BorderColor=#00FFFF,ttl
offhub commented 10 months ago

Prevent MS Edge auto update from running on the host system and in the sandbox to see if the same issues occur.

[GlobalSettings]
NotifyForceProcessDisabled=y
AlertFolder=%ProgramFiles% (x86)\Microsoft\EdgeUpdate
WriteFilePath=%ProgramFiles% (x86)\Microsoft\EdgeUpdate
qazero commented 10 months ago

Thanks, I'm giving this a shot now and will report back in a few days or weeks to see if it resolves the issue.

DavidXanatos commented 10 months ago

@qazero did it work for you?

qazero commented 9 months ago

It's too soon to say for sure, I need some more time to continue testing. But I think this issue may have 2 underlying sub-issues:

  1. I usually leave my computer running 24/7 with sever tabs open in Microsoft Edge. However, sometimes when I come back to the computer after a few hours I notice that when I try to navigate to a new website nothing loads. It doesn't return an error either, it just seems to do nothing when I type in a website and press enter. The tabs which I had open previously remain working just fine but if I try navigating to a new page it doesn't load either.

  2. Also, sometimes when I return to the computer after a few hours the web browser is all blacked out and I can't see or click on anything.

Issue 1 hasn't returned so far but I will continue testing.

Issue 2 has returned after 3 days of leaving Microsoft Edge open. When I returned to my PC the window was all black and I couldn't see anything. But when I would use my mouse to click anywhere in the black window, I could see that the webpage was change and navigating to new pages from the mouse clicks (this could be seen as the window title would change in the Windows bar at the bottom of the screen).

qazero commented 9 months ago

Another update. This morning when I accessed my computer I confirm issue 1 still remains present as well. So it doesn't look like the fix worked. Also, coincidently, I see that Microsoft Edge pushed an Update on October 4th according to their changelog.

offhub commented 9 months ago

Did the update occur inside or outside the sandbox? Check the C:\Sandbox\user\sandbox\drive\C\Program Files (x86)\Microsoft\Edge\Application folder, if the folder is empty, the update was made from outside the sandbox.

qazero commented 9 months ago

That folder doesn't exist right now because I had to restart Edge and every time I close Edge I have Sandboxie set to automatically delete the contents of the sandbox. Once closed I usually open Edge outside of the sandbox to do the update. Once the update is complete I close Edge and open it up in Sandboxie.

So we'll need to wait a few days until the next Edge update and I'll report back.

qazero commented 9 months ago

Did the update occur inside or outside the sandbox? Check the C:\Sandbox\user\sandbox\drive\C\Program Files (x86)\Microsoft\Edge\Application folder, if the folder is empty, the update was made from outside the sandbox.

So the issue occurred again this morning. The directory doesn't exist inside the sandbox but found it outside the sandbox and the timestamps align. So as you suspected, it is being updated outside of the sandbox. How do you recommend I can fix this without disabling updates altogether (since that would be a pretty big security risk)?

Prior to using Edge, I used to use Google Chrome and also Brave and never encountered this issue. Whenever I wanted to update, all I had to do was start the browser outside of the sandbox and it would automatically update. Then I'd close it and launch it sandboxed again. This is what I currently do in Edge as well but whenever there is an update the sandboxed browser stops working and it forces me to abruptly close the browser which is a nuisance as it interrupts my work. Is there any workaround you'd recommend? Perhaps allowing direct unsandboxed access to the Application directory (not sure whether or not this would solve the issue or how much of a security compromise this would be)?

I've search on Google for how I can disable auto Edge updates but they all seem to mention renaming files/folders, editing the hosts file, or modifying the Windows registry. While these may actually work in preventing Edge updates, I don't think it is a very practical solution since it would be a nuisance to manually go back and revert those changes every time I'd want to update. Any recommendations and guidance would be much appreciated. Thanks!

offhub commented 9 months ago

If the Microsoft Edge Updater is updating Edge's files while msedge.exe is running, the same problem is likely to occur outside of the sandbox. (Can you confirm this?)

In this case: (choose one of the following)

  1. Turn off automatic updating for Microsoft Edge.
  2. If Microsoft Edge is not your default browser, copy the Edge\Application folder to a different folder and use msedge.exe in that location (e.g. Edge\Application2).
  3. [You must use the Sandboxie Plus interface (SandMan.exe) for this option] If you have a fixed sandbox for Microsoft Edge, use Microsoft Edge by creating a default snapshot in that box.

    [!NOTE] In this case, msedge.exe will run as if it were installed in the sandbox, so some of Sandboxie's features may not work as normal for msedge.exe, e.g. you won't be able to use start restrictions or OpenFilePath (you'll need to use OpenPipePath instead of OpenFilePath).

    • Disable AutoDelete of the sandbox. (Temporarily)
    • Delete the content
    • Run CMD in the sandbox and then close it.
    • Open the Snapshots Manager window by right-clicking on the sandbox.
    • From this window, use Take Snapshot to create a new snapshot and mark it as Default.
    • Open Windows Explorer (unsandboxed) to navigate to the snapshot-x folder in the Sandbox folder. (e.g. C:\Sandbox\user\sandbox\snapshot-1)
    • Create the drive\C\Program Files (x86)\Microsoft\Edge folder in the snapshot-x folder and copy the Application folder under C:\Program Files (x86)\Microsoft\Edge (on the host) to the sandboxed snapshot-x folder. [!NOTE] You must repeat this copying process when you update Microsoft Edge. (or you can use the following setting)
    ### Automate the copy process: (Only valid for option 3)
    
    #### From the GUI:
    ```
    Sandboxie-Plus > Right click on the sandbox > Sandbox Options > Advanced Options > Triggers
    On Delete Content > Run Command
    ```
    
    > [!WARNING]
    > `On Box Delete` command is executed **UNSANDBOXED** before the sandbox contents are deleted! Do not execute these commands on your system without trying them on a virtual machine. Use at your own risk!
    
    ```
    cmd /c "if exist "C:\Program Files (x86)\Microsoft\Edge\Application\new_msedge.exe" (exit) else (robocopy /MIR "C:\Program Files (x86)\Microsoft\Edge\Application" "C:\Sandbox\%USER%\%SANDBOX%\snapshot-1\drive\C\Program Files (x86)\Microsoft\Edge\Application")"
    ```
    
    ### OR
    
    #### For Sandboxie.ini (Do NOT put it under [GlobalSettings]!)
    
    > [!WARNING]
    > `On Box Delete` command will be executed **UNSANDBOXED** before the sandbox content is deleted! Do not run these commands on your system without trying them on a virtual machine. Use at your own risk!
    
    ```
    OnBoxDelete=cmd /c "if exist "C:\Program Files (x86)\Microsoft\Edge\Application\new_msedge.exe" (exit) else (robocopy /MIR "C:\Program Files (x86)\Microsoft\Edge\Application" "C:\Sandbox\%USER%\%SANDBOX%\snapshot-1\drive\C\Program Files (x86)\Microsoft\Edge\Application")"
    ```
    
    <details>
      <summary>Command line explanation</summary>
    
    ```
    cmd.exe /C "robocopy /MIR "<SOURCE>" "<DESTINATION>"":
    
    cmd.exe /C :: Carries out the command specified by string and then terminates
    robocopy /MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).
    robocopy /E :: copy subdirectories, including Empty ones.
    robocopy /PURGE :: delete dest files/dirs that no longer exist in source.
    
    ```
    </details>
    • Enable AutoDelete of the sandbox.
qazero commented 9 months ago

Just to confirm that I am understanding you correctly, all I need to do is add the following line to my DefaultBox in my Sandboxie.ini? I am using Sandboxie Classic and Edge is my default browser. I don't need to do any of the other things mentioned above?

OnBoxDelete=cmd /c "if exist "C:\Program Files (x86)\Microsoft\Edge\Application\new_msedge.exe" (exit) else (robocopy /MIR "C:\Program Files (x86)\Microsoft\Edge\Application" "C:\Sandbox\%USER%\%SANDBOX%\snapshot-1\drive\C\Program Files (x86)\Microsoft\Edge\Application")"

offhub commented 9 months ago

Option 3 and below are only valid for the Plus version and will not work in the Classic version.

qazero commented 9 months ago

Understood. I'll try upgrading to the Plus version and try the option 3 with the automated copy process per your instructions above and report back.

qazero commented 9 months ago

I tried Option 3 but whenever I try opening Edge it opens with a blank white screen with nothing visible inside and then when I click anywhere inside the white box it crashes and closes. Any ideas?

offhub commented 6 months ago

Could you please try with the following setting?

OpenKeyPath=msedge.exe,HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate

qazero commented 6 months ago

Happy new year!! Hope all is well with you and thank you for getting back to me.

Yes, I can certainly give that a try, but before I do, could you please confirm that the provided instructions are working on your end? That would be preferred to avoid additional unnecessary back and forth. :)

qazero commented 1 month ago

Any update regarding this? Issue is still outstanding and crashing regularly.