Skip to content
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

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

Open
soleera opened this issue Aug 19, 2023 · 4 comments
Labels
Confirmation Pending Further confirmation is requested Feature: Program Control Issues with control structures

Comments

@soleera
Copy link

soleera commented Aug 19, 2023

Describe what you noticed and did

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.

Notes:

  • Opening via right click > "Open with..." > "VS Code" works as expected
  • Opening via the command line (e.g. PS>/path/to/file.txt) works as expected
  • Issue persists even when setting BreakoutProcess=* or BreakoutFolder=*
  • Issue does not occur when using DisableForceRules=y
  • Even when running VS Code unsandboxed, if the current workspace has been set to trusted and you attempt to open the sandboxed text file, processes started by this action will still cause this issue (e.g. dozens of git.exe processes suddenly spawn inside the sandbox)

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
@soleera soleera added the Confirmation Pending Further confirmation is requested label Aug 19, 2023
@DavidXanatos
Copy link
Member

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

@offhub
Copy link
Collaborator

offhub commented Aug 24, 2023

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
Copy link
Collaborator

offhub commented Aug 24, 2023

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
sbiecode_20230824_163452.mp4

@Simba98
Copy link

Simba98 commented Sep 11, 2023

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

@offhub offhub added the Feature: Program Control Issues with control structures label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmation Pending Further confirmation is requested Feature: Program Control Issues with control structures
Projects
None yet
Development

No branches or pull requests

4 participants