Add notes for System.Reflection.Metadata and System.Reflection.PortableExecutable.PEReader - #12412
Merged
tommcdon merged 4 commits intoMar 18, 2026
Merged
Conversation
…s for untrusted input
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds documentation cautions warning that System.Reflection.Metadata readers (with exceptions) and System.Reflection.PortableExecutable.PEReader aren’t designed to handle untrusted/malicious inputs.
Changes:
- Add
[!CAUTION]callouts to theSystem.Reflection.MetadataandSystem.Reflection.PortableExecutablenamespace docs. - Add
[!CAUTION]callouts toMetadataReader,MetadataReaderProvider, andPEReadertype remarks.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| xml/ns-System.Reflection.PortableExecutable.xml | Adds a namespace-level caution for PE reading APIs. |
| xml/ns-System.Reflection.Metadata.xml | Adds a namespace-level caution for metadata readers, with exceptions called out. |
| xml/System.Reflection.PortableExecutable/PEReader.xml | Adds a type-level caution about untrusted PE input. |
| xml/System.Reflection.Metadata/MetadataReaderProvider.xml | Adds a type-level caution about untrusted metadata/PDB input. |
| xml/System.Reflection.Metadata/MetadataReader.xml | Adds a type-level caution about untrusted metadata input. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
gewarren
approved these changes
Mar 17, 2026
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.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.
Adds a note stating that System.Reflection.Metadata (except for TypeName and AssemblyNameInfo) and System.Reflection.PortableExecutable.PEReader do not support unsafe inputs.