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

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


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

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.