Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Protect the fallback temporary home directory by enforcing and checking its file mode on Unix platforms - #27985

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:msrc-home-fallback
Sep 22, 2026
Merged

Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:msrc-home-fallback

Conversation

@daxian-dbw

@daxian-dbw Dongbo Wang (daxian-dbw) commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

PR Summary

Protect the home fallback directory by checking its Unix permission mode -- PowerShell always creates the temporary home directory with the user-only permission, so if its mode is not what we expect, then it indicates the directory may be tampered (e.g. a different local user created it) and we fail the startup for security reason.

PR Checklist

Copilot AI lite review requested due to automatic review settings September 8, 2026 17:33
@daxian-dbw
Dongbo Wang (daxian-dbw) requested a review from a team as a code owner September 8, 2026 17:33
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A newly introduced user-facing error message is potentially misleading about the condition being detected, and should be adjusted for accuracy before merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR hardens PowerShell startup on Unix when HOME is not set by creating (and validating) a fallback temporary home directory with user-only permissions, and failing fast if that directory appears unsafe.

Changes:

  • Create the fallback temp HOME directory with explicit user-only Unix permissions (0700) and validate the resulting mode.
  • Add a localized error message for the unsafe-permission startup failure case.
File summaries
File Description
src/System.Management.Automation/CoreCLR/CorePsPlatform.cs Creates temp HOME with explicit UnixFileMode and throws on unexpected permissions.
src/System.Management.Automation/resources/CoreClrStubResources.resx Adds a new resource string for the unsafe temp HOME permission startup error.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@daxian-dbw Dongbo Wang (daxian-dbw) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 8, 2026
@daxian-dbw

Copy link
Copy Markdown
Member Author

Rebased and force-pushed the branch to fix CIs.

@daxian-dbw Dongbo Wang (daxian-dbw) changed the title Prevent the fallback temporary home directory from being tampered Protect the fallback temporary home directory by enforcing and checking its file mode on Unix platforms Sep 16, 2026
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 154bbe8 into PowerShell:master Sep 22, 2026
38 checks passed
@daxian-dbw
Dongbo Wang (daxian-dbw) deleted the msrc-home-fallback branch September 22, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.7.x-Done CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants