Skip to content

Commit

Permalink
fix xml security issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Qu committed Nov 12, 2015
1 parent 7085e0f commit 9f402aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ooxml/openxml4Net/Util/XmlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ public static void LoadXmlSafe(XmlDocument xmlDoc, Stream stream)
{
XmlReaderSettings settings = new XmlReaderSettings();
//Disable entity parsing (to aviod xmlbombs, External Entity Attacks etc).
settings.XmlResolver = null;
settings.ProhibitDtd = true;
//settings.MaxCharactersFromEntities = 4096;
//settings.ValidationType = ValidationType.DTD;

XmlReader reader = XmlReader.Create(stream, settings);
xmlDoc.Load(reader);
}
Expand Down

0 comments on commit 9f402aa

Please sign in to comment.