Skip to content

Commit

Permalink
Fix | Prohibit DtdProcessing on XmlTextReader instance in .NET Core (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra committed Jan 18, 2021
1 parent f0c9fa6 commit f23e0d6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1155,8 +1155,8 @@ internal static SqlNotification ProcessMessage(SqlXml xmlMessage)
return null;
}

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

0 comments on commit f23e0d6

Please sign in to comment.