| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Sorry, something went wrong.
There was a problem hiding this comment.
Reused web sessions retain default credentials after UseDefaultCredentials is disabled, while credential-cache handling also causes redirect-authentication and connection-reuse regressions.
3 open issuesThis PR hardens credential handling in PowerShell’s web cmdlets by scoping credentials to the request origin unless redirect authorization preservation is enabled.
Changes:
| File | Description |
|---|---|
| test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 | Expands credential-scoping tests for both web cmdlets. |
| src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestSession.cs | Adds origin-scoped credential cache creation. |
| src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs | Routes explicit and default credentials through the new session helper. |
Review effort: Balanced
Sorry, something went wrong.
| else if (UseDefaultCredentials) | ||
| { | ||
| WebSession.UseDefaultCredentials = true; | ||
| WebSession.SetCredential(CredentialCache.DefaultNetworkCredentials, CheckProtocol(Uri), PreserveAuthorizationOnRedirect); |
| // Get the relevant NetworkCredential | ||
| NetworkCredential netCred = Credential.GetNetworkCredential(); | ||
| WebSession.Credentials = netCred; | ||
| WebSession.SetCredential(Credential.GetNetworkCredential(), CheckProtocol(Uri), PreserveAuthorizationOnRedirect); |
| cache.Add(origin, scheme, cred); | ||
| } | ||
|
|
||
| Credentials = cache; |
| Back | FazBrowse Home | New Git URL |
PR Summary
PR Context
PR Checklist