Repository navigation
Add CodeQL comments to clarify trusted input handling in ResourcesGen… - #11763
Conversation
…erator and UidManager
There was a problem hiding this comment.
Pull request overview
This PR adds inline CodeQL suppression/justification comments for rule SM00414 in WPF build tasks, documenting that the flagged file-path flows originate from developer-authored MSBuild items (build-time inputs), rather than runtime/untrusted user input.
Changes:
- Annotates
File.OpenRead(inputFile.ItemSpec)call sites inUidManagerwith CodeQL SM00414 trusted-input justification. - Annotates file deletion/existence checks in
UidManager.RemoveFilewith CodeQL SM00414 trusted-input justification. - Annotates resource file existence validation in
ResourcesGenerator.ValidResourceFileswith CodeQL SM00414 trusted-input justification.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/UidManager.cs | Adds CodeQL SM00414 suppress/justify comments on build-time file IO (read/delete/move) paths derived from MSBuild items. |
| src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/ResourcesGenerator.cs | Adds CodeQL SM00414 suppress/justify comment on resource file existence checks using MSBuild ItemSpec-derived paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The comments by copilot are not fully valid, but I think we should truncate the reasoning that we have provided. It should be a minimum of 25 chars as per the rules but if copilot suggest that analyzer will find it difficult to read, then we should consider truncating it. |
|
@dotnet-policy-service agree |
Adds a suppression comment for CodeQL finding SM00414.
After investigation, the reported data flows were determined to be build-time only and originate from trusted MSBuild inputs (ITaskItem.ItemSpec values such as ResourceFiles, OutputResourcesFile, and _markupFiles). These values are supplied by the project file and build items authored by the developer performing the build, not by untrusted external users or runtime application input.
This area can be re-evaluated in the future if these tasks begin accepting untrusted or externally supplied input.
Microsoft Reviewers: Open in CodeFlow