Bug 35115 - Dissallow AppDomain with ReflectionPermission.NoFlags to call private methods.
Summary: Dissallow AppDomain with ReflectionPermission.NoFlags to call private methods.
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Aleksey Kliger
Depends on:
Reported: 2015-10-20 18:17 UTC by Aleksey Kliger
Modified: 2015-10-20 18:17 UTC (History)
1 user (show)

See Also:
Is this bug a regression?: ---
Last known good build:

reflection permission example. (3.44 KB, application/octet-stream)
2015-10-20 18:17 UTC, Aleksey Kliger

Description Aleksey Kliger 2015-10-20 18:17:12 UTC
Created attachment 13467 [details]
reflection permission example.

Creating an AppDomain with ReflectionPermission(ReflectionPermissionFlags.NoFlags) should disallow reflection from invoking private (protected, internal) methods and accessing private (protected, internal) fields.

Reproduction steps:

mcs reflPermExample.cs
mono reflPermExample.exe

Expected Output:

{{ MethodAccessException when trying to call hello_private }}

Actual Output:

Type ShyTypes.ShyType has methods: 
 - hello_public;
  attempting to invoke hello_public.
  invoked hello_public
 - hello_private;
  attempting to invoke hello_private.
  invoked hello_private

Note You need to log in before you can comment on or make changes to this bug.