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

OpenFilePath directories are not enumerated within their parent folders #3519

Closed
antiufo opened this issue Dec 23, 2023 · 1 comment
Closed
Labels
Blue box Sandboxes with data protection Confirmation pending Further confirmation is requested fixed in next build Fixed in the next Sandboxie version

Comments

@antiufo
Copy link

antiufo commented Dec 23, 2023

Describe what you noticed and did

  1. Create a new "Sandbox with Data Protection" (leaving all the default settings)
  2. Outside the sandbox, mkdir C:\Test1 and mkdir C:\Test2
  3. Sandbox options -> Resources -> Files -> Add C:\Test1 as "Normal" and C:\Test2 as "Open", save settings
  4. Run cmd inside the sandbox
  5. dir C:\

Actual outcome:

 Directory of C:\

2023-12-23  14:52    <DIR>          .
2023-12-23  14:52    <DIR>          ..
2023-12-23  14:52    <DIR>          Program Files
2023-12-23  14:52    <DIR>          Program Files (x86)
2023-12-23  14:50    <DIR>          Test1
2023-12-23  14:52    <DIR>          Users
2023-12-23  14:52    <DIR>          Windows
               0 File(s)              0 bytes
               7 Dir(s)  157,686,128,640 bytes free

Notice that only Test1 is visible, but not Test2.
Interestingly, if I cd C:\Test2, then I can use the folder as expected (creating a file inside the sandboxed cmd actually creates it in the real C:\Test2)

Additionally:
dir C:\Te* only displays Test1, whereas
dir C:\Te*2 successfully displays Test2.

I discovered this issue because some programs (understandably) fail to launch if they can't see and enumerate their own parent folders

How often did you encounter it so far?

I can reproduce it consistently

Affected program

Not relevant

Download link

Not relevant

Where is the program located?

Not relevant to my request.

Expected behavior

Both Test1 and Test2 should be visible when dir'ing C:\

What is your Windows edition and version?

Windows 10.0.19044.3803 (x64)

In which Windows account you have this problem?

An account with UAC protection completely turned off.

Please mention any installed security software

None

What version of Sandboxie are you running?

1.12.5

Is it a new installation of Sandboxie?

I just updated Sandboxie from a previous version (I don't remember which one).

Is it a regression?

No response

In which sandbox type you have this problem?

In a sandbox with data protection (blue sandbox icon).

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 response

Crash dump

No response

Trace log

No response

Sandboxie.ini configuration

[GlobalSettings]

Template=Edge_Fix
Template=Edge_Win11Fix
Template=RpcPortBindings
Template=7zipShellEx
Template=WindowsRasMan
Template=WindowsLive
Template=OfficeLicensing
FileRootPath=\??\%SystemDrive%\Sandbox\%USER%\%SANDBOX%
SeparateUserFolders=y
KeyRootPath=\REGISTRY\USER\Sandbox_%USER%_%SANDBOX%
IpcRootPath=\Sandbox\%USER%\%SANDBOX%\Session_%SESSION%
NetworkEnableWFP=n
EnableObjectFiltering=n
EnableWin32kHooks=n

[New_Box_1]
Enabled=y
BlockNetworkFiles=y
RecoverFolder=%{374DE290-123F-4565-9164-39C4925E467B}%
RecoverFolder=%Personal%
RecoverFolder=%Desktop%
BorderColor=#f88501,ttl
Template=OpenBluetooth
Template=SkipHook
Template=FileCopy
Template=qWave
Template=BlockPorts
Template=LingerPrograms
Template=AutoRecoverIgnore
ConfigLevel=10
UsePrivacyMode=y
UseFileDeleteV2=y
UseRegDeleteV2=y
AutoRecover=y
NormalFilePath=C:\Test1
OpenFilePath=C:\Test2
@antiufo antiufo added the Confirmation pending Further confirmation is requested label Dec 23, 2023
@offhub
Copy link
Collaborator

offhub commented Dec 23, 2023

The same problem seems to exist with directives other than OpenFilePath. Only one item is enumerated per drive(?).

test.bat
@echo off

set sbieIni="C:\Program Files\Sandboxie-Plus\SbieIni.exe"
set startExe="C:\Program Files\Sandboxie-Plus\Start.exe"
set boxName=sbieTest123Box
set scriptPath=%~dp0
set folderPrefix=sbieTEST

cd /d "%temp%"

md "%folderPrefix%1" "%folderPrefix%2" "%folderPrefix%3" "%folderPrefix%4" "%folderPrefix%5" "%folderPrefix%6" "%folderPrefix%7" "%folderPrefix%8" "%folderPrefix%9"

%sbieIni% set %boxName% Enabled y
%sbieIni% set %boxName% UsePrivacyMode y
%sbieIni% set %boxName% NormalFilePath %scriptPath%test-sandboxed.bat
%sbieIni% append %boxName% NormalFilePath %temp%\%folderPrefix%1
%sbieIni% append %boxName% NormalFilePath %temp%\%folderPrefix%2
%sbieIni% append %boxName% NormalFilePath %temp%\%folderPrefix%3
%sbieIni% append %boxName% OpenFilePath %temp%\%folderPrefix%4
%sbieIni% append %boxName% OpenFilePath %temp%\%folderPrefix%5
%sbieIni% append %boxName% OpenFilePath %temp%\%folderPrefix%6
%sbieIni% append %boxName% ReadFilePath %temp%\%folderPrefix%7
%sbieIni% append %boxName% ReadFilePath %temp%\%folderPrefix%8
%sbieIni% append %boxName% ReadFilePath %temp%\%folderPrefix%9

cd /d "%~dp0"

echo @echo off>"test-sandboxed.bat"
echo dir "%temp%\%folderPrefix%*">>"test-sandboxed.bat"
echo pause>>"test-sandboxed.bat"

%startExe% /box:%boxName% "%scriptPath%test-sandboxed.bat"

@DavidXanatos DavidXanatos added the Blue box Sandboxes with data protection label Dec 23, 2023
@DavidXanatos DavidXanatos added the fixed in next build Fixed in the next Sandboxie version label Jan 7, 2024
DavidXanatos added a commit that referenced this issue Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blue box Sandboxes with data protection Confirmation pending Further confirmation is requested fixed in next build Fixed in the next Sandboxie version
Projects
None yet
Development

No branches or pull requests

3 participants