sandboxie-plus / Sandboxie

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

BreakoutProcess option does not work when opening files directly or using context menu options #3217

Open soleera opened 1 year ago

soleera commented 1 year ago

Describe what you noticed and did

Steps:

Notes:

I believe this is the same issue as #1883.

Log: vscode_sandboxie_open.zip

How often did you encounter it so far?

Always

Affected program

VS Code, git, krita, inkscape, ... (likely program-agnostic)

Download link

https://code.visualstudio.com/

Where is the program located?

The program is installed only outside the sandbox.

Expected behavior

when set as a BreakoutProcess, the process should not be sandboxed.

What is your Windows edition and version?

Windows 11 Home 10.0.22621 Build 22621

In which Windows account you have this problem?

A local account (Standard user)., A local account (Administrator).

Please mention any installed security software

Windows Security

What version of Sandboxie are you running?

1.9.2 & 1.10.5

Is it a new installation of Sandboxie?

I recently did a new clean installation.

Is it a regression?

Possibly? #1883 was closed as fixed in release 1.1.1

In which sandbox type you have this problem?

All sandbox types (I tried them all).

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?

No

Crash dump

No response

Trace log

See above

Sandboxie.ini configuration

[GlobalSettings]
FileRootPath=%USERPROFILE%\scoop\persist\sandboxie-plus\Sandbox\%SANDBOX%
KeyRootPath=\REGISTRY\USER\Sandbox_%USER%_%SANDBOX%
IpcRootPath=\Sandbox\%USER%\%SANDBOX%\Session_%SESSION%
Template=Edge_Fix
Template=WindowsRasMan
Template=WindowsLive
Template=OfficeLicensing
DefaultBox=DefaultBox
SeparateUserFolders=y
ForceDisableSeconds=10

[UserSettings_08C401B6]
SbieCtrl_AutoStartAgent=SandMan.exe -autorun
SbieCtrl_EnableAutoStart=y
SbieCtrl_HideMessage=2205, ConsoleInit (C00000D4)
SbieCtrl_RecoverTarget=C:\Users\<user>\Desktop
SbieCtrl_RecoverTarget=C:\Users\<user>\Documents
BoxGrouping=:DefaultBox, ...
CollapsedBoxes=: ...

[DefaultBox]
Enabled=y
AutoRecover=y
BlockNetworkFiles=y
RecoverFolder=%{374DE290-123F-4565-9164-39C4925E467B}%
RecoverFolder=%Personal%
RecoverFolder=%Desktop%
BorderColor=#00fd00,off,6
Template=OpenBluetooth
Template=SkipHook
Template=FileCopy
Template=qWave
Template=BlockPorts
Template=LingerPrograms
Template=AutoRecoverIgnore
Template=RpcPortBindingsExt
ConfigLevel=10
BoxNameTitle=n
CopyLimitKb=81920
UseFileDeleteV2=y
UseRegDeleteV2=y
NoSecurityIsolation=y
NoSecurityFiltering=y
NoAddProcessToJob=y
UnrestrictedSCM=y
RunServicesAsSystem=y
ExposeBoxedSystem=y
StripSystemPrivileges=n

[<sandbox>]
Enabled=y
BlockNetworkFiles=y
RecoverFolder=%{374DE290-123F-4565-9164-39C4925E467B}%
RecoverFolder=%Personal%
RecoverFolder=%Desktop%
BorderColor=#027df7,off,6
Template=OpenBluetooth
Template=SkipHook
Template=FileCopy
Template=qWave
Template=BlockPorts
Template=LingerPrograms
Template=AutoRecoverIgnore
ConfigLevel=10
UseFileDeleteV2=y
UseRegDeleteV2=y
AutoRecover=y
FakeAdminRights=y
UseSecurityMode=y
BreakoutProcess=Code.exe
BreakoutProcess=git.exe
BreakoutProcess=krita.exe
BreakoutProcess=inkscape.exe
DavidXanatos commented 1 year ago

i cant reproduce the issue, anyone else with that problem?

offhub commented 1 year ago

Steps:

  • Install VS Code unsandboxed and with the context menu option enabled.
  • Setup a sandbox (any type) with BreakoutProcess=Code.exe
  • Create a text file in the sandbox and try to open it by either double-clicking or right click > "Open with Code"
  • VS Code attempts to start in the sandbox despite being a breakout process.

When I opened the document this way, Code.exe crashed and the dump file was created in sandbox. (HOST, Windows 10 22H2)

I will also try it in a virtual machine. (Hyper-V, Windows 11 22H2)

offhub commented 1 year ago

Windows 11 22H2 (22621.1848) [Hyper-V]

program boxed boxed path type result info
cmd NO NO Command OK -
cmd NO YES Command CRASH Code.exe
cmd YES NO Command OK -
WinExp NO YES Right click CRASH Code.exe
WinExp NO YES Dobule click OK -
WinExp NO YES Right click OK -
WinExp YES NO Right click CRASH? WinExp closes when the context is opened
WinExp YES YES Double click OK -

cmd (UNSANDBOXED)
Current Directory: [Real Path] "C:\Users\Win11Test"
Action/Command: "C:\Users\Win11Test\AppData\Local\Programs\Microsoft VS Code\Code.exe" "C:\Sandbox\Win11Test\New_Box\user\current\TEST.txt"
Result: OK

cmd (UNSANDBOXED)
Current Directory: [Sandboxed Path] "C:\Sandbox\Win11Test\New_Box\user\current\"
Action/Command: "C:\Users\Win11Test\AppData\Local\Programs\Microsoft VS Code\Code.exe" "C:\Sandbox\Win11Test\New_Box\user\current\TEST.txt"
Result: CRASH

cmd (SANDBOXED)
Current Directory: [Real Path] "C:\Users\Win11Test\"
Action/Command: "C:\Users\Win11Test\AppData\Local\Programs\Microsoft VS Code\Code.exe" "C:\Sandbox\Win11Test\New_Box\user\current\TEST.txt"
Result: OK

Windows Explorer (UNSANDBOXED)
Current Directory: [Sandboxed Path] "C:\Sandbox\Win11Test\New_Box\user\current\"
Action/Command: Right click > Open With Code
Result: CRASH

Windows Explorer (UNSANDBOXED)
Current Directory: [Sandboxed Path] "C:\Sandbox\Win11Test\New_Box\user\current\"
Action/Command: Double click [VS Code is default app]
Result: OK

Windows Explorer (UNSANDBOXED)
Current Directory: [Sandboxed Path] "C:\Sandbox\Win11Test\New_Box\user\current\"
Action/Command: Right click > Open with > Visual Studio Code
Result: OK

Windows Explorer (SANDBOXED)
Current Directory: [Real Path] "C:\Users\Win11Test\"
Action/Command: Right click > ???
Result: CRASH??? [Windows Explorer closes when the context menu is opened]

Windows Explorer (SANDBOXED)
Current Directory: "C:\Users\Win11Test\" [Sandboxed Path]
Action/Command: Double click [VS Code is default app]
Result: OK

[8084:0824/153644.530:ERROR:registration_protocol_win.cc(107)] CreateFile: The system cannot find the file specified. (0x2)
[8084:0824/153644.691:ERROR:gpu_process_host.cc(989)] GPU process launch failed: error_code=21
[8084:0824/153644.774:ERROR:gpu_process_host.cc(989)] GPU process launch failed: error_code=21
[8084:0824/153644.849:ERROR:gpu_process_host.cc(989)] GPU process launch failed: error_code=21
[8084:0824/153644.937:FATAL:platform_handle_in_transit.cc(65)] DuplicateHandle failed from FFFFFFFFFFFFFFFF to 0000000000000A24 for handle 0000000000000A20: Access is denied. (0x5)
[8084:0824/153644.953:ERROR:crashpad_client_win.cc(142)] crash server failed to launch
[main 2023-08-24T12:36:45.297Z] update#setState disabled
[main 2023-08-24T12:36:45.303Z] update#ctor - updates are disabled due to running as Admin in user setup
[8084:0824/153645.311:ERROR:gpu_process_host.cc(989)] GPU process launch failed: error_code=21
[main 2023-08-24T12:36:45.319Z] CodeWindow: renderer process gone (reason: launch-failed, code: 21)
[8084:0824/153645.396:ERROR:gpu_process_host.cc(989)] GPU process launch failed: error_code=21

https://github.com/sandboxie-plus/Sandboxie/assets/6871698/1ecc7229-bf3e-497a-b46b-9df0f5e05c7f

Simba98 commented 1 year ago

I have a similar issue, and especially the git.exe will be forced into sandbox.