Add Fuzz Tests#26384
Merged
TravisEz13 merged 6 commits intoPowerShell:masterfrom Nov 6, 2025
Merged
Conversation
TravisEz13
reviewed
Nov 5, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds fuzzing infrastructure for PowerShell using SharpFuzz and libfuzzer-dotnet. The fuzzing targets the HyperV socket token extraction functionality in the remoting layer to discover potential parsing vulnerabilities.
Key changes:
- Adds fuzzing test infrastructure with a dedicated FuzzingApp project
- Refactors token extraction logic into a testable
ExtractFuzzedTokenmethod - Exposes internal methods for fuzzing via
InternalsVisibleToattribute
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/fuzzing/runFuzzer.ps1 | New PowerShell script to orchestrate the fuzzing workflow (build, instrument, execute) |
| test/fuzzing/FuzzingApp/powershell-fuzz-tests.csproj | Project file for fuzzing test harness targeting .NET 10.0 |
| test/fuzzing/FuzzingApp/Program.cs | Fuzzing harness entry point that invokes SharpFuzz on token extraction |
| test/fuzzing/inputs/mininput | Minimal fuzzing corpus input |
| test/fuzzing/inputs/maxinput | Maximum fuzzing corpus input with extended character set |
| src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs | Refactors token parsing into ExtractFuzzedToken method and updates call sites |
| src/System.Management.Automation/AssemblyInfo.cs | Adds InternalsVisibleTo for fuzzing test assembly |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TravisEz13
reviewed
Nov 5, 2025
TravisEz13
reviewed
Nov 5, 2025
Member
Author
|
/azp run |
|
Commenter does not have sufficient privileges for PR 26384 in repo PowerShell/PowerShell |
TravisEz13
approved these changes
Nov 5, 2025
SIRMARGIN
pushed a commit
to SIRMARGIN/PowerShell
that referenced
this pull request
Dec 12, 2025
Co-authored-by: anamnavi <annavied@microsoft.com>
kilasuit
pushed a commit
to kilasuit/PowerShell
that referenced
this pull request
Jan 2, 2026
Co-authored-by: anamnavi <annavied@microsoft.com>
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
PR Context
Add fuzz tests, to fuzz token received from HyperV-Socket response. This uses LibFuzzer and SharpFuzz, and the tests can be run via the included script, which builds the FuzzingApp project, instruments its .dll as well as the dependent SMA .dll. The corpus includes 2 files, maxinput and mininput as valid input examples.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header