Skip to content

Add notes for System.Reflection.Metadata and System.Reflection.PortableExecutable.PEReader - #12412

Merged
tommcdon merged 4 commits into
dotnet:mainfrom
tommcdon:dev/tomcdon/docPEReader_SysRefMetadata
Mar 18, 2026
Merged

Add notes for System.Reflection.Metadata and System.Reflection.PortableExecutable.PEReader#12412
tommcdon merged 4 commits into
dotnet:mainfrom
tommcdon:dev/tomcdon/docPEReader_SysRefMetadata

Conversation

@tommcdon

Copy link
Copy Markdown
Member

Adds a note stating that System.Reflection.Metadata (except for TypeName and AssemblyNameInfo) and System.Reflection.PortableExecutable.PEReader do not support unsafe inputs.

@tommcdon
tommcdon requested review from agocke and hoyosjs March 17, 2026 17:59
@tommcdon
tommcdon requested a review from a team as a code owner March 17, 2026 17:59
Copilot AI review requested due to automatic review settings March 17, 2026 17:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 the System.Reflection.Metadata and System.Reflection.PortableExecutable namespace docs.
  • Add [!CAUTION] callouts to MetadataReader, MetadataReaderProvider, and PEReader type 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.

Comment thread xml/ns-System.Reflection.Metadata.xml Outdated
Comment thread xml/System.Reflection.PortableExecutable/PEReader.xml Outdated
Comment thread xml/System.Reflection.Metadata/MetadataReaderProvider.xml Outdated
Comment thread xml/System.Reflection.Metadata/MetadataReader.xml Outdated
Comment thread xml/ns-System.Reflection.PortableExecutable.xml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread xml/System.Reflection.Metadata/MetadataReader.xml Outdated
Comment thread xml/ns-System.Reflection.Metadata.xml Outdated
tommcdon and others added 2 commits March 17, 2026 16:23
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
@tommcdon
tommcdon merged commit 574fcb8 into dotnet:main Mar 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants