Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add CodeQL suppressions for EventLog, NativeCommandProcessor, TypeCatalogGen, Process methods#26467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
anamnavi wants to merge3 commits intoPowerShell:master
base:master
Choose a base branch
Loading
fromanamnavi:codeql-suppressions

Conversation

@anamnavi
Copy link
Member

@anamnavianamnavi commentedNov 17, 2025
edited
Loading

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. No functional code changes are included. Also fixed typo and updated prior CodeQL suppressions.

These changes do not affect runtime behavior but improve code documentation and static analysis compliance.

PR Summary

PR Context

PR Checklist

CopilotAI review requested due to automatic review settingsNovember 17, 2025 16:15
@anamnavianamnavi changed the titleadd CodeQL suppressionsAdd CodeQL suppressionsNov 17, 2025
@anamnavianamnavi changed the titleAdd CodeQL suppressionsAdd CodeQL suppressions for EventLog, NativeCommandProcessor, TypeCatalogGen, Process methodsNov 17, 2025
@anamnavianamnavi added the CL-ToolsIndicates that a PR should be marked as a tools change in the Change Log labelNov 17, 2025
Copy link
Contributor

CopilotAI 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-related behaviors in PowerShell's codebase. The changes clarify that certain security warnings (command-line injection, SSRF, weak cryptography) are intentional design decisions based on PowerShell's trust model where users have full control and responsibility for the code they execute.

Key changes:

  • Corrects spelling of "Poweshell" to "PowerShell" in 7 existing CodeQL suppression comments
  • Adds 5 new CodeQL suppression comments for command-line injection warnings in process-related code
  • Adds 1 new CodeQL suppression comment for SHA-1 weak cryptography usage (backwards compatibility)

Reviewed Changes

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

Show a summary per file
FileDescription
TypeCatalogGen.csAdds weak-crypto suppression for SHA-1 hash algorithm used for backwards compatibility
FileSystemProvider.csCorrects "Poweshell" to "PowerShell" in command-line-injection-shell-execution suppression
UpdatableHelpSystem.csCorrects "Poweshell" to "PowerShell" in two SSRF suppressions
RunspaceConnectionInfo.csCorrects "Poweshell" to "PowerShell" in SSH process command-line-injection suppression
NativeCommandProcessor.csAdds new command-line-injection suppression and corrects "Poweshell" to "PowerShell" in two existing suppressions
WebRequestPSCmdlet.Common.csCorrects "Poweshell" to "PowerShell" in SSRF suppression
Process.csAdds two new command-line-injection suppressions for working directory paths and corrects "Poweshell" to "PowerShell" in existing suppression
Eventlog.csAdds new command-line-injection suppression for ComputerName parameter in event viewer launch

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

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot added the Review - NeededThe PR is being reviewed labelNov 25, 2025
@microsoft-github-policy-service
Copy link
Contributor

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for7 days.
Maintainer, please provide feedback and/or mark it asWaiting on Author

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

CopilotAI 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 8 out of 8 changed files in this pull request and generated 1 comment.


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

// codeql[cs/microsoft/command-line-injection-shell-execution] - This is expectedPoweshell behavior where user inputted paths are supported for the context of this method. The user assumes trust for the file path specified, so any file executed in the runspace would be in the user's local system/process or a system they have access to in which case restricted remoting security guidelines should be used.
ProcessStartInfostartInfo=new(filePath);
// codeql[cs/microsoft/command-line-injection-shell-execution] - This is expectedPowerShell behavior where user inputted paths are supported for the context of this method. The user assumes trust for the file path specified, so any file executed in the runspace would be in the user's local system/process or a system they have access to in which case restricted remoting security guidelines should be used.
System.Diagnostics.ProcessStartInfostartInfo=newSystem.Diagnostics.ProcessStartInfo(filePath);
Copy link

CopilotAIDec 1, 2025

Choose a reason for hiding this comment

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

The change fromProcessStartInfo toSystem.Diagnostics.ProcessStartInfo is inconsistent with the existing code style in this file and adds unnecessary verbosity. TheProcessStartInfo type is already imported viausing System.Diagnostics; at the top of the file, so the fully qualified name is redundant. This change should be reverted to maintain consistency with the rest of the codebase.

Suggested change
System.Diagnostics.ProcessStartInfostartInfo=newSystem.Diagnostics.ProcessStartInfo(filePath);
ProcessStartInfostartInfo=newProcessStartInfo(filePath);

Copilot uses AI. Check for mistakes.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@daxian-dbwdaxian-dbwAwaiting requested review from daxian-dbwdaxian-dbw is a code owner

@TravisEz13TravisEz13Awaiting requested review from TravisEz13TravisEz13 is a code owner

@adityapatwardhanadityapatwardhanAwaiting requested review from adityapatwardhanadityapatwardhan is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

CL-ToolsIndicates that a PR should be marked as a tools change in the Change LogReview - NeededThe PR is being reviewed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@anamnavi

[8]ページ先頭

©2009-2025 Movatter.jp