Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow Add-Type in NoLanguage mode on a locked down machine #16245

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

TravisEz13
Copy link
Member

PR Summary

Normally, the Add-Type cmdlet is disallowed when PowerShell is run on a locked down system. However, an admin on a locked down system can create a NoLanguage remoting endpoint, and that endpoint configuration will allow the Add-Type cmdlet. The admin can create a remote connection to the NoLanguage endpoint on the same machine, and use Add-Type cmdlet to compile and run arbitrary C# code.

This fix disallows the use of Add-Type cmdlet in a NoLanguage mode PowerShell session, on a locked down machine.

PR Context

PR Checklist

Normally, the Add-Type cmdlet is disallowed when PowerShell is run on a locked down system.  However, an admin on a locked down system can create a NoLanguage remoting endpoint, and that endpoint configuration will allow the Add-Type cmdlet.  The admin can create a remote connection to the NoLanguage endpoint on the same machine, and use Add-Type cmdlet to compile and run arbitrary C# code.

This fix disallows the use of Add-Type cmdlet in a NoLanguage mode PowerShell session, on a locked down machine.

Cherry picked from !17521
@ghost ghost assigned rjmholt Oct 14, 2021
Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the title to the following. It's used for 7.0.8 and 7.1.5.

Disallow Add-Type in NoLanguage mode on a locked down machine

@TravisEz13 TravisEz13 changed the title Add-type NoLanguage mode vuln fix Disallow Add-Type in NoLanguage mode on a locked down machine Oct 14, 2021
@TravisEz13 TravisEz13 changed the title Disallow Add-Type in NoLanguage mode on a locked down machine Disallow Add-Type in NoLanguage mode on a locked down machine Oct 14, 2021
@rjmholt rjmholt merged commit 3893c4d into PowerShell:master Oct 14, 2021
@TravisEz13 TravisEz13 deleted the wdac branch October 14, 2021 22:13
@daxian-dbw daxian-dbw added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 15, 2021
daxian-dbw pushed a commit to daxian-dbw/PowerShell that referenced this pull request Oct 21, 2021
@ghost
Copy link

ghost commented Oct 21, 2021

🎉v7.2.0-rc.1 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Dec 16, 2021

🎉v7.3.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport-7.0.x-Done BackPort-7.1.x-Done Backport to 7.1.x completed Backport-7.2.x-Done CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants