Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set load-external-dtd to false when loading xml files #437

Closed
cherylking opened this issue Jan 31, 2024 · 1 comment · Fixed by #438
Closed

Set load-external-dtd to false when loading xml files #437

cherylking opened this issue Jan 31, 2024 · 1 comment · Fixed by #438
Assignees

Comments

@cherylking
Copy link
Member

Check for places that load xml files and set the load-external-dtd flag to false.

One placed I identified already: XmlDocument.createDocument(File)

DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
f.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false); 
f.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); 
@cherylking
Copy link
Member Author

Also affected:

HttpPortUtil.getHttpPortFromConfigVariableXML
ServerConfigDocument.getDocumentBuilder
DevUtil.getOmitFilesList
ServerFeatureUtil.getServerXmlFeatures

Finally, both LMP and LGP have a bunch of tests that load XML files and should specify these flags. Just search for DocumentBuilderFactory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant