Skip to content

Commit 57fa416

Browse files
Security Fix | Prohibit DtdProcessing on XmlTextReader instance in .NET Core (#885)
1 parent 1862210 commit 57fa416

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDependencyListener.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1155,8 +1155,8 @@ internal static SqlNotification ProcessMessage(SqlXml xmlMessage)
11551155
return null;
11561156
}
11571157

1158-
// Create a new XmlTextReader on the Message node value.
1159-
using (XmlTextReader xmlMessageReader = new XmlTextReader(xmlReader.Value, XmlNodeType.Element, null))
1158+
// Create a new XmlTextReader on the Message node value. Prohibit DTD processing when dealing with untrusted sources.
1159+
using (XmlTextReader xmlMessageReader = new XmlTextReader(xmlReader.Value, XmlNodeType.Element, null) { DtdProcessing = DtdProcessing.Prohibit })
11601160
{
11611161
// Proceed to the Text Node.
11621162
if (!xmlMessageReader.Read())

0 commit comments

Comments
 (0)