Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

Conversation

@anamnavi
Copy link
Member

@anamnavi anamnavi commented Jan 14, 2026

Add CodeQL suppression comments to clarify that certain potential security issues (such as command-line injection and weak cryptography) are expected behaviors in PowerShell, given its design and user trust model. These comments provide context for static analysis tools and future maintainers. Also fixed typo and updated prior CodeQL suppressions.

Also updated how System special folder is retrieved in EventLog.cs, it calls into the CorePSPlatform.SafeDeriveFromSpecialFolder() API to ensure the configured location is returned regardless of if it exists.

PR Summary

PR Context

PR Checklist

Copilot AI review requested due to automatic review settings January 14, 2026 17:31
Copy link
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

This PR adds CodeQL suppression comments to document expected security behaviors in PowerShell and fixes a recurring typo where "Poweshell" was corrected to "PowerShell" in existing suppression comments. The changes clarify that certain potential security issues (command-line injection, SSRF, weak cryptography) are intentional design choices given PowerShell's user trust model. No functional code changes are included.

Changes:

  • Added new CodeQL suppression comments for command-line injection scenarios in TypeCatalogGen, NativeCommandProcessor, Process, and EventLog classes
  • Corrected spelling of "Poweshell" to "PowerShell" in seven existing CodeQL suppression comments across multiple files
  • All suppressions explain why the flagged behavior is expected in PowerShell's context

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/TypeCatalogGen/TypeCatalogGen.cs Added suppression for SHA-1 usage explaining backward compatibility requirement
src/System.Management.Automation/namespaces/FileSystemProvider.cs Fixed typo in existing suppression comment
src/System.Management.Automation/help/UpdatableHelpSystem.cs Fixed typo in two existing SSRF suppression comments
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs Fixed typo in existing suppression comment
src/System.Management.Automation/engine/NativeCommandProcessor.cs Added new suppression and fixed typos in two existing suppressions
src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs Fixed typo in existing SSRF suppression comment
src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs Added two new suppressions for working directory paths and fixed typo in existing suppression
src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs Added new suppression for ComputerName parameter usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@TravisEz13 TravisEz13 left a comment

Choose a reason for hiding this comment

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

see comments

@microsoft-github-policy-service microsoft-github-policy-service bot added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jan 15, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jan 20, 2026
…sures the configured location will be returned regardless of if it has been created already
@anamnavi anamnavi changed the title Add CodeQL suppressions for EventLog, NativeCommandProcessor, TypeCatalogGen, Process methods Add CodeQL suppressions for EventLog, TypeCatalogGen, Process methods Jan 27, 2026
@TravisEz13 TravisEz13 added the PowerShell-Docs needed The PR was reviewed and a PowerShell Docs update is needed label Jan 28, 2026
@TravisEz13 TravisEz13 self-assigned this Jan 28, 2026
@TravisEz13 TravisEz13 added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log PowerShell-Docs needed The PR was reviewed and a PowerShell Docs update is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants