CVE-2018-8421용 .NET 보안 업데이트를 설치한 후 SharePoint 워크플로 작동이 중지됩니다.

적용 대상
SharePoint Server

증상

resolve CVE-2018-8421(.NET Framework 원격 코드 실행 취약성)에 대한 2018년 9월 .NET Framework 보안 업데이트를 설치한 후 SharePoint 기본 제공 워크플로가 작동을 중지합니다. 이 문제가 발생하면 다음과 유사한 오류 항목이 기록됩니다.

<Date> <Time> w3wp.exe (0x1868) 0x22FC SharePoint Foundation Workflow Infrastructure 72fs Unexpected RunWorkflow: Microsoft.SharePoint.SPException: <Error><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1"…

오류 항목은 System.CodeDom.CodeBinaryOperatorExpression 이 권한 있는 형식에 포함되지 않음을 나타냅니다.

9월 .NET 보안 업데이트에 대한 자세한 내용은 이 Microsoft .NET 블로그 페이지로 이동하세요.

원인

WF(Workflow Foundation)는 다음 트리의 .NET 구성 파일에서 모든 종속 형식 및 어셈블리에 권한이 부여되거나 코드를 통해 명시적으로 추가된 경우에만 워크플로를 실행합니다.

<configuration>

<System.Workflow.ComponentModel.WorkflowCompiler>

<authorizedTypes>

<targetFx>

그러나 업데이트 후에는 이전에 필요하지 않았던 SharePoint 기본 제공 워크플로에서 사용되는 일부 형식이 필요합니다.

해결 방법

이 문제를 resolve 다음 기술 자료 문서에서 적절한 보안 및 비보안 업데이트를 적용합니다.

4461501 SharePoint Enterprise Server 2016의 보안 업데이트 설명: 2018년 11월 13일

4461508 2018년 11월 13일 SharePoint Foundation 2013(KB4461508) 누적 업데이트

4461510 2018년 11월 13일 SharePoint Enterprise Server 2013(KB4461510) 누적 업데이트
 
4011713 2018년 11월 13일 SharePoint Foundation 2010(KB4011713) 업데이트

4461528 2018년 11월 13일 SharePoint Server 2010(KB4461528) 누적 업데이트

참고

  • 업데이트가 설치되면 수정 사항이 완전히 적용되려면 SharePoint 제품 구성 마법사를 실행해야 합니다.
  • 일부 타사 또는 사용자 지정 워크플로 작업에는 추가 종속성이 있을 수 있습니다. 이 문제와 유사하지만 이 문서에서 다루지 않는 동작이 발생하는 경우 워크플로 작업 개발자에게 도움을 요청하세요.

해결 방법

이 문제를 해결하려면 모든 애플리케이션의 Web.config 파일에 필요한 형식을 명시적으로 추가합니다. 수동 단계가 제공되지만 스크립트 메서드를 사용하는 것이 좋습니다.

수동으로 형식 추가

이 문제를 해결하려면 모든 애플리케이션의 web.config 파일에 필요한 형식을 명시적으로 추가합니다.

SharePoint 2013 이상 버전

SharePoint 2013 이상 버전의 경우 다음 줄을 추가합니다.

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeBinaryOperatorExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodePrimitiveExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeMethodInvokeExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeMethodReferenceExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeFieldReferenceExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeThisReferenceExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodePropertyReferenceExpression" Authorized="True" />
 

SharePoint 2013 이전 버전의 경우

2013년 이전 SharePoint 버전의 경우 다음 줄을 대신 추가합니다.

<authorizedType Assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeBinaryOperatorExpression" Authorized="True" />

<authorizedType Assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodePrimitiveExpression" Authorized="True" />

<authorizedType Assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeMethodInvokeExpression" Authorized="True" />

<authorizedType Assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeMethodReferenceExpression" Authorized="True" />

<authorizedType Assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeFieldReferenceExpression" Authorized="True" />

<authorizedType Assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeThisReferenceExpression" Authorized="True" />

<authorizedType Assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodePropertyReferenceExpression" Authorized="True" />

스크립트를 통해 형식 추가

기존 파일을 직접 수정하는 대신 다음 스크립트를 실행하는 것이 좋습니다.

참고 일부 타사 워크플로 엔진에는 추가 형식을 추가해야 할 수 있습니다. 이 경우 공급자에게 필요한 형식에 대한 정보를 문의한 다음 그에 따라 스크립트를 조정합니다.

다음 스크립트는 모든 웹 애플리케이션이 필요한 항목을 추가하도록 Web.config 변경합니다. 이 스크립트는 기존 웹 애플리케이션 및 스크립트 실행 후 생성된 애플리케이션에 대해 이러한 형식을 추가합니다. 스크립트는 팜의 모든 웹 프런트 엔드 서버에서 한 번만 실행해야 합니다(모든 서버를 업데이트합니다).

<#

 This script adds the entries to all web.config files for all web applications in the farm.

 Run this script as Farm Administrator in one of the WFEs.

 This script has to run only one time.

SUMMARY:

This script uses the native SharePoint SPWebConfigModification API to deploy new updates to the web.config file for each web application on each server in the farm.  Servers that are added at a later date will also get the updates applied because the API configuration is persisted in the config database.  This API does not update the web.config for the central administration web application.

If you are running workflows on the central admin web application, you will have to manually update the web.config by using the steps in the referenced blog.

==============================================================

#>

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null

function Add-CodeDomAuthorizedType

{

    <#

    .Synopsis

       Adds the necessary authorizedType elements to all web.config files for all non-central admin web applications

    .DESCRIPTION

       Adds the necessary authorizedType elements to all web.config files for all non-central admin web applications

    .EXAMPLE

       Add-CodeDomAuthorizedType

    #>

    [CmdletBinding()]

    param

    (

    )

    begin

    {

        $farmMajorVersion = (Get-SPFarm -Verbose:$false ).BuildVersion.Major

        $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService

        $typeNames = @( "CodeBinaryOperatorExpression", "CodePrimitiveExpression", "CodeMethodInvokeExpression", "CodeMethodReferenceExpression", "CodeFieldReferenceExpression","CodeThisReferenceExpression", "CodePropertyReferenceExpression")

    }

    process

    {

        if( @($contentService.WebConfigModifications | ? { $_.Name -eq "NetFrameworkAuthorizedTypeUpdate" }).Count -gt 0 )

        {

            Write-Warning "Existing NetFrameworkAuthorizedTypeUpdate entries found, this script has to be run only one time per farm."

            return

        }

        if( $farmMajorVersion -le 14 ) # 2010, 2007

        {

            foreach( $typeName in $typeNames )

            {

                # System, Version=2.0.0.0

                $netFrameworkConfig = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification

                $netFrameworkConfig.Path     = "configuration/System.Workflow.ComponentModel.WorkflowCompiler/authorizedTypes"

                $netFrameworkConfig.Name     = "authorizedType[@Assembly='System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'][@Namespace='System.CodeDom'][@TypeName='{0}'][@Authorized='True']" -f $typeName

                $netFrameworkConfig.Owner    = "NetFrameworkAuthorizedTypeUpdate"

                $netFrameworkConfig.Sequence = 0

                $netFrameworkConfig.Type     = [Microsoft.SharePoint.Administration.SPWebConfigModification+SPWebConfigModificationType]::EnsureChildNode

                $netFrameworkConfig.Value    = '<authorizedType Assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.CodeDom" TypeName="{0}" Authorized="True"/>' -f $typeName

                $contentService.WebConfigModifications.Add($netFrameworkConfig);

            }

        }

        else # 2013+

        {

            foreach( $typeName in $typeNames )

            {

                # System, Version=4.0.0.0

                $netFrameworkConfig = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification

                $netFrameworkConfig.Path     = "configuration/System.Workflow.ComponentModel.WorkflowCompiler/authorizedTypes/targetFx"

                $netFrameworkConfig.Name     = "authorizedType[@Assembly='System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'][@Namespace='System.CodeDom'][@TypeName='{0}'][@Authorized='True']" -f $typeName

                $netFrameworkConfig.Owner    = "NetFrameworkAuthorizedTypeUpdate"

                $netFrameworkConfig.Sequence = 0

                $netFrameworkConfig.Type     = [Microsoft.SharePoint.Administration.SPWebConfigModification+SPWebConfigModificationType]::EnsureChildNode

                $netFrameworkConfig.Value    = '<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.CodeDom" TypeName="{0}" Authorized="True"/>' -f $typeName

                $contentService.WebConfigModifications.Add($netFrameworkConfig);

            }

        }

        Write-Verbose "Updating web.configs"

        $contentService.Update()

        $contentService.ApplyWebConfigModifications();

    }

    end

    {

    }   

}

function Remove-CodeDomAuthorizedType

{

    <#

    .Synopsis

       Removes any web configuration entries owned by "NetFrameworkAuthorizedTypeUpdate"

    .DESCRIPTION

       Removes any web configuration entries owned by "NetFrameworkAuthorizedTypeUpdate"

    .EXAMPLE

        Remove-CodeDomAuthorizedType

    #>

    [CmdletBinding()]

    param()

    begin

    {

        $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService

    }

    process

    {

        $webConfigModifications = @($contentService.WebConfigModifications | ? { $_.Owner -eq "NetFrameworkAuthorizedTypeUpdate" })

        foreach ( $webConfigModification in $webConfigModifications )

        {

            Write-Verbose "Found instance owned by NetFrameworkAuthorizedTypeUpdate"

            $contentService.WebConfigModifications.Remove( $webConfigModification ) | Out-Null

        }

        if( $webConfigModifications.Count -gt 0 )

        {

            $contentService.Update()

            $contentService.ApplyWebConfigModifications()

        }

    }

    end

    {

    }   

}

# The following command will get the timerjob responsible for the web.config change deployment

# Get-SPTimerJob | ? { $_.Name -eq "job-webconfig-modification" }

# The following command will make the appropriate changes

Add-CodeDomAuthorizedType

# Remove the following command if you have to remove the web.config updates, you can use this function to retract the changes

# Remove-CodeDomAuthorizedType