Skip to content

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

Merged
Rob Holt (rjmholt) merged 1 commit into
PowerShell:masterfrom
TravisEz13:wdac
Oct 14, 2021
Merged

Rob Holt (rjmholt) merged 1 commit into
PowerShell:masterfrom
TravisEz13:wdac

Conversation

@TravisEz13

Copy link
Copy Markdown
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

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment •

Copy link
Copy Markdown
Member

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 Travis Plunk (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 Travis Plunk (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
Rob Holt (rjmholt) merged commit 3893c4d into PowerShell:master Oct 14, 2021
@daxian-dbw Dongbo Wang (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
@ghost

Copy link
Copy Markdown

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

Handy links:

@ghost

Copy link
Copy Markdown

🎉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.

4 participants