PKumar022351 (Community Member) asked a question.

Improper Restriction of XML External Entity Reference (CWE ID 611)

My Existing code:

public synchronized Element parse(String xmlString) throws SAXException, IOException

{

Document doc = null;

DocumentBuilder documentBuilder = XMLParserUtils.getXMLDocBuilder();

if(xmlString!= null){

doc = documentBuilder.parse(new InputSource(new StringReader(xmlString)));

}

return doc.getDocumentElement();

}

 

Getting Improper Restriction of XML External Entity Reference in highlighted line. Can you please help how can resolve this flaws.


Topics (3)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.