microsoft / microsoft/mxc

BaseContainer: rename not allowed in TEMP folder

Open
#1,204 0 comments 0 reactions 0 assignees View on GitHub
Issue-Bug Needs-Triage OS-Windows
Dominant language
Rust
Stars
1.3k
Forks
79
Avg merge
2d 7h
Merged PRs (30d)
117

Description

### Relevant area(s)

Windows

### Brief description of your issue

When a process is launched in a process container sandbox with T1 support (BaseContainer PSEC) the %TEMP% env var is set to something like `C:\Users\\AppData\Local\P\Packages\sandbox.{271fc3b3-bc0b-4ead-bb14-ad5226896536}\AC\Temp` with a random guid that is different each time. However, that folder doesn't have sufficient permissions as it allow creation and deletion of file within but not rename and that is creating some issues with programs like npm and dotnet.

As a workaround I have to give readwrite permission to `C:\Users\\AppData\Local\P\Packages\` (since I cannot predict the guid) however is not correct since it give permission to other package folders as well. Giving this permission renames are allowed.

### Steps to reproduce

Launch a program in a process container sandbox that creates and then rename files in the TEMP folder.

### Expected behavior

I expect that the program is able to create and delete files in its own TEMP folder.

### Actual behavior

It gets access denied during renaming.

Contributor guide

Open the contributing guide

Research direction

Start with the Windows BaseContainer PSEC/T1 sandbox setup and reproduce the access-denied rename in the generated TEMP folder. Inspect how permissions are assigned to that folder, then verify that a sandboxed process can create, rename, and delete files in its own TEMP directory without granting access to other package folders.

Written by the indexing model from the issue text.

Assessment

Domain
operating-systems, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.