Skip to content

Downgrade system IL impersonation token to high#40447

Merged
Brian-Perkins merged 4 commits intomasterfrom
user/bperkins/downgrade_system_il
May 7, 2026
Merged

Downgrade system IL impersonation token to high#40447
Brian-Perkins merged 4 commits intomasterfrom
user/bperkins/downgrade_system_il

Conversation

@Brian-Perkins
Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Creating objects while impersonating service accounts with an integrity level of 'system' can cause problems because the VM worker process only runs at 'high' IL. Downgrade 'system' to 'high'.

Validation Steps Performed

Manually ran scenarios under NetworkService account.

Copilot AI review requested due to automatic review settings May 6, 2026 22:31
@Brian-Perkins Brian-Perkins requested a review from a team as a code owner May 6, 2026 22:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adjusts duplicated user tokens so that when a duplicated token has System integrity level, it is downgraded to High integrity level to match the VM worker process and avoid access issues on created objects.

Changes:

  • Adds TOKEN_ADJUST_DEFAULT to the duplicated token’s access rights.
  • Detects System IL on the duplicated token and sets its integrity level to High via SetTokenInformation(TokenIntegrityLevel).

Comment thread src/windows/common/WslSecurity.cpp Outdated
OneBlue
OneBlue previously approved these changes May 7, 2026
Copy link
Copy Markdown
Collaborator

@OneBlue OneBlue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/windows/common/WslSecurity.cpp Outdated
Comment thread src/windows/common/WslSecurity.cpp Outdated
benhillis
benhillis previously approved these changes May 7, 2026
Copilot AI review requested due to automatic review settings May 7, 2026 16:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/windows/common/WslSecurity.cpp Outdated
benhillis
benhillis previously approved these changes May 7, 2026
@Brian-Perkins Brian-Perkins disabled auto-merge May 7, 2026 16:42
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 7, 2026 16:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/windows/common/WslSecurity.cpp
@Brian-Perkins Brian-Perkins enabled auto-merge (squash) May 7, 2026 17:07
@Brian-Perkins Brian-Perkins merged commit 7dd4096 into master May 7, 2026
15 checks passed
@Brian-Perkins Brian-Perkins deleted the user/bperkins/downgrade_system_il branch May 7, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants