diff --git a/xml/System.Reflection.Emit/AssemblyBuilder.xml b/xml/System.Reflection.Emit/AssemblyBuilder.xml index c2c048fcb2c..ee6e05f93d9 100644 --- a/xml/System.Reflection.Emit/AssemblyBuilder.xml +++ b/xml/System.Reflection.Emit/AssemblyBuilder.xml @@ -76,7 +76,18 @@ Defines and represents a dynamic assembly. - For more information about this API, see Supplemental API remarks for AssemblyBuilder. + + [!WARNING] +> `AssemblyBuilder` APIs require a fully trusted environment with trusted input, similar to other technologies such as compilers. There are no restrictions other than basic validation for generated IL that the `AssemblyBuilder` can contain. That includes validation for member name, count, and associated metadata, such as custom attributes. +]]> + + [!WARNING] +> There are no restrictions, other than basic validation, for ILGenerator APIs that produce method IL. If untrusted input is used for producing IL: +> +> - IL and metadata can contain secrets provided by the consumer. +> - IL can be invalid, such as not having balanced push versus pop opcodes, or invalid operands for a given opcode. +> - IL can contain any code that might, for example, deadlock, have infinite stack recursion, or have an infinite loop. +> - IL can load and execute code on any other reachable assembly. +> +> Such code can do whatever it wishes when the method is loaded and executed. To protect against such vulnerabilities, `ILGenerator` requires a fully trusted environment with trusted input. ]]> diff --git a/xml/System.Reflection.Emit/PersistedAssemblyBuilder.xml b/xml/System.Reflection.Emit/PersistedAssemblyBuilder.xml index 34a88531211..5ac7b40f00e 100644 --- a/xml/System.Reflection.Emit/PersistedAssemblyBuilder.xml +++ b/xml/System.Reflection.Emit/PersistedAssemblyBuilder.xml @@ -25,7 +25,17 @@ Provides an AssemblyBuilder implementation that can persist assembly to a disk or stream. - To be added. + + [!WARNING] +> `PersistedAssemblyBuilder` APIs require a fully trusted environment with trusted input, similar to other technologies such as compilers. There are no restrictions other than basic validation for generated IL that the `AssemblyBuilder` can contain. That includes validation for member name, count, and associated metadata, such as custom attributes. +]]> +