uschindler commented on code in PR #16135:
URL: https://github.com/apache/lucene/pull/16135#discussion_r3328623182


##########
lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java:
##########
@@ -106,6 +106,11 @@ static XMLReader createParser() {
     try {
       SAXParserFactory factory = SAXParserFactory.newInstance();
       factory.setNamespaceAware(true);
+      // this parser is non-validating and only reads pattern data, so refuse 
to load
+      // any external DTD or entity to prevent XXE from an untrusted 
hyphenation file
+      
factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd";,
 false);

Review Comment:
   Please use provided constants if possible. Hardcoding the URLS is a no-go.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to