สรุป
ช่องโหว่การเรียกใช้โค้ดจากระยะไกลใน Microsoft Visual Studio 2019 และStudio Visual 2017อยู่ ถ้ามีแฟ้ม XOML (Extensible วัตถุ Markup Language) บางชนิดการอ้างอิง และทำให้โค้ดที่สุ่มให้ทำงานเมื่อเปิดแฟ้มใน Visual Studio
มีข้อจำกัดที่อนุญาตชนิดที่จะใช้ในแฟ้ม.xoml อยู่ในขณะนี้ ถ้าคุณเปิดแฟ้ม.xoml มีที่ไม่ได้รับอนุญาตใหม่ชนิดใดชนิดหนึ่งที่ประกอบด้วยอยู่ คุณได้รับข้อผิดพลาดที่แจ้งว่า ชนิดไม่ได้รับอนุญาต
To เรียนรู้เพิ่มเติมเกี่ยวกับช่องโหว่ที่ ไปCVE 2019 1113
วิธีแก้ไขปัญหาชั่วคราว
ถ้าแฟ้ม.xoml เปิดทำให้เกิดปัญหาด้านความปลอดภัย คุณสามารถปิดใช้งานขั้นตอนการตรวจสอบสำหรับชนิดที่ไม่ได้รับอนุญาต เมื่อต้องการทำเช่นนี้ เพิ่มคีย์ไปยัง<appSettings>ส่วนของแฟ้มdevenv.exe.configดัง:
...
<appSettings>
<add key="microsoft:WorkflowComponentModel:DisableXOMLSerializerTypeChecking" value="true"/>
</appSettings>
...
ปิดใช้งานชนิดการตรวจสอบในซีเรียลไลเซอร์ XOML (Extensible วัตถุ Markup Language) นี้appSettingค่าอย่างสมบูรณ์ ถ้ามีตั้งค่าเป็นtrueก็จะมีความสำคัญเหนือค่าappSettingใหม่สำหรับชนิดที่เฉพาะเจาะจงเท่านั้นที่อนุญาตให้ทำดังต่อไปนี้
ถ้าคุณต้องการไม่อนุญาตให้บางชนิดที่เฉพาะเจาะจงเท่านั้น คุณจำเป็นต้องทำการเปลี่ยนแปลงต่อไปนี้ไปยังแฟ้มdevenv.exe.config :
...
<appSettings>
<add key="microsoft:WorkflowComponentModel:DisableXOMLSerializerDefaultUnauthorizedTypes" value="true"/>
</appSettings>
...
การเปลี่ยนแปลงนี้ทำให้ทุกชนิดที่จะไม่ได้รับอนุญาตตามค่าเริ่มต้น การทำเครื่องหมายเป็นไม่ได้รับอนุญาตบางชนิด คุณยังจำเป็นต้องทำการเปลี่ยนแปลงต่อไปนี้ไปยังแฟ้มdevenv.exe.config :
...
<configuration>
...
<configSections>
<sectionGroup name="System.Workflow.ComponentModel.WorkflowCompiler" type="System.Workflow.ComponentModel.Compiler.WorkflowCompilerConfigurationSectionGroup, System.Workflow.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="authorizedTypes" type="System.Workflow.ComponentModel.Compiler.AuthorizedTypesSectionHandler, System.Workflow.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</sectionGroup>
</configSections>
...
<System.Workflow.ComponentModel.WorkflowCompiler>
<authorizedTypes>
<foo version="v4.0">
<authorizedType Assembly="System.Activities.Presentation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Activities.Presentation" TypeName="WorkflowDesigner" Authorized="false"/>
</foo>
</authorizedTypes>
</System.Workflow.ComponentModel.WorkflowCompiler>
...
</configuration>
...
การเปลี่ยนแปลงเหล่านี้ทำเครื่องหมายเฉพาะชนิดWorkflowDesignerในแอสเซมบลีSystem.Activities.Presentationเป็นไม่ได้รับอนุญาต เป็นดังนี้:
-
รุ่น: 4.0.0.0
-
Culture:กลาง
-
PublicKeyToken: 31bf3856ad364e35
การทำเครื่องหมายชนิดอื่น ๆ เป็นไม่ได้รับอนุญาต คุณสามารถเพิ่มรายการที่คล้ายกันสำหรับชนิดเหล่านั้น