Skip to content

Commit

Permalink
Security Fix | Prohibit DtdProcessing on XmlTextReader instance in .N…
Browse files Browse the repository at this point in the history
…ET Core (#885)
  • Loading branch information
cheenamalhotra authored Jan 18, 2021
1 parent 1862210 commit 57fa416
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 57fa416

Please sign in to comment.