Skip to content

Commit d0b4b01

Browse files
committed
XmlConfigurator: do longer allow dtd processing across all platforms (LOG4NET-575)
This patch fixes a security vulnerabiliy reported by Karthik Balasundaram. The security vulnerability was found in the way how log4net parses xml configuration files where it allowed to process XML External Entity Processing. An attacker could use this as an attack vector if he could modify the XML configuration file.
1 parent c04a774 commit d0b4b01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Config/XmlConfigurator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,9 @@ static private void InternalConfigure(ILoggerRepository repository, Stream confi
736736
#if NETSTANDARD1_3 // TODO DtdProcessing.Parse not yet available (https://github.com/dotnet/corefx/issues/4376)
737737
settings.DtdProcessing = DtdProcessing.Ignore;
738738
#elif !NET_4_0 && !MONO_4_0
739-
settings.ProhibitDtd = false;
739+
settings.ProhibitDtd = true;
740740
#else
741-
settings.DtdProcessing = DtdProcessing.Parse;
741+
settings.DtdProcessing = DtdProcessing.Ignore;
742742
#endif
743743

744744
// Create a reader over the input stream

0 commit comments

Comments
 (0)