Skip to content

Commit 47edec8

Browse files
Add security note to SetRemoteStackTrace
1 parent ff94eb5 commit 47edec8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

xml/System.Runtime.ExceptionServices/ExceptionDispatchInfo.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,14 @@ This method populates the <xref:System.Exception.StackTrace> property from an ar
178178
allowing preservation of the exception object's stack trace information. .NET does not attempt to parse the
179179
provided string value.
180180
181-
The caller is responsible for canonicalizing line endings if required. <xref:System.String.ReplaceLineEndings>
181+
The caller is responsible for canonicalizing line endings if required. <xref:System.String.ReplaceLineEndings>
182182
can be used to canonicalize line endings.
183183
184+
If the caller provides untrusted input to this API, this may result in the exception's stack trace containing
185+
embedded null characters, reserved HTML or JSON characters, or other unexpected values. Applications that
186+
display an exception's details to the user should always take care to encode the exception information at the
187+
point where it is displayed.
188+
184189
]]></format>
185190
</remarks>
186191
<exception cref="T:System.ArgumentNullException">The <paramref name="source" /> or <paramref name="stackTrace" /> argument was <see langword="null" />.</exception>

0 commit comments

Comments
 (0)