dotnet / dotnet/linker

Consider detecting indirect access to reflection APIs

Open
#1,168 0 comments 0 reactions 0 assignees View on GitHub
task
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

E.g. XmlSerializer reflection-emits calls to `Activator.CreateInstance`. These accesses are not safe because linker has no chance to analyze it.

This might be pretty easy to pull off because technically we only need to check whether any of the methods we're marking in `MarkMethodsOnTypeHierarchy` do `RequiresReflectionMethodBodyScanner`.

We could theoretically detect delegate creation pointing to an unsafe API this way too.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.