Improve remote prompt handling for PSCredential and SecureString arrays - #28007
Merged
Dongbo Wang (daxian-dbw) merged 2 commits intoSep 11, 2026
Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
Dongbo Wang (daxian-dbw) merged 2 commits into
Conversation
Anam Navied (anamnavi)
requested review from
a team,
Travis Plunk (TravisEz13) and
Dongbo Wang (daxian-dbw)
as code owners
September 11, 2026 17:24
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Nested array types can bypass the intended remote prompt protections.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Improves remoting prompt handling for PSCredential and SecureString arrays and qualified type names.
Changes:
- Adds sensitive-type checks for arrays.
- Normalizes array and assembly-qualified type names.
- Nested arrays still need consistent recursive handling.
File summaries
| File | Summary |
|---|---|
src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHost.cs |
Adds array-aware security checks; jagged arrays require further handling. |
src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs |
Recognizes normalized sensitive type names. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Patrick Meinecke (SeeminglyScience)
approved these changes
Sep 11, 2026
Dongbo Wang (daxian-dbw)
approved these changes
Sep 11, 2026
Dongbo Wang (daxian-dbw)
merged commit Sep 11, 2026
a71ba38
into
PowerShell:master
36 of 37 checks passed
| { | ||
| if (typeName.Equals(nameof(PSCredential), StringComparison.OrdinalIgnoreCase)) | ||
| string effectiveName = typeName; | ||
| int suffixIndex = effectiveName.IndexOfAny(new char[] { '[', ',' }); |
Collaborator
There was a problem hiding this comment.
Extra allocation.
Suggested change
| int suffixIndex = effectiveName.IndexOfAny(new char[] { '[', ',' }); | |
| int suffixIndex = effectiveName.IndexOfAny('[', ','); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
This pull request improves handling of PSCredential and SecureString types in PowerShell remoting, including cases where these types are used in arrays or specified with assembly-qualified names. The changes ensure these types are consistently recognized and processed across a wider range of remoting scenarios
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header