Skip to content

Commit

Permalink
Merge pull request #24 from jenkinsci/SECURITY-2832
Browse files Browse the repository at this point in the history
SECURITY-2832: Fix for XXE Vulnerability
  • Loading branch information
vaibhavjain2 committed Aug 25, 2022
2 parents dbe85e1 + 351a467 commit 8410fd5
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ private static String parseXml(InputStream versionfile) throws IOException
try
{
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
dbFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
dbFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document document = dBuilder.parse(versionfile);

Expand Down

0 comments on commit 8410fd5

Please sign in to comment.