Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Security: PermissionSets do not carry over to new AppDomains #12901

@sbrl

Description

@sbrl

If I create a new PermissionSet and create a new AppDomain with it, then it the permissions don't carry over.

I've also filed a related issue over in #12900, which may be worth checking out too.

Steps to Reproduce

  1. Download this test case project: PermissionSets.tar.gz
  2. Compile it with msbuild.
  3. Run the program with mono --security TestProject.exe

Current Behavior

The following output can be observed:

*** Expected permissions ***
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Execution"/>
</PermissionSet>

*** Permissions of sandbox ***
<PermissionSet class="System.Security.PermissionSet"
version="1"
Unrestricted="true"/>

Although the program creates a PermissionSet that only allows the Execute SecurityPermissionFlag, the AppDomain is actually created with unrestricted permissions - ignoring the PermissionSet completely!

Expected Behavior

On Windows, the PermissionSet the program creates and the PermissionSet the AppDomain actually has are identical. This is what Mono should do too.

On which platforms did you notice this

[ ] macOS
[x] Linux
[ ] Windows

Version Used:

Mono JIT compiler version 5.18.0.240 (tarball Wed Jan 16 09:10:16 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	Interpreter:   yes
	LLVM:          yes(600)
	Suspend:       preemptive
	GC:            sgen (concurrent by default)

Stacktrace

Not applicable, but if there's anything else I can provide to aid in the tracking down of the issue, I'd be happy to help.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions