MLazarin161759 (Community Member) asked a question.

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

Hello

 

Veracode static report showing below highlighted line as vulnerable. Input (body) is a XML of type String. Sample java code uses JAXBContext to parse and XMLInputFactory follows OWASP recommendation to disable DTD. Could you please review and advise? Thanks

 

 

XMLInputFactory xmlInputFactory = XMLInputFactory.newFactory();

xmlInputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);

xmlInputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);

 

final XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(new StringReader(body));

 

JAXBContext jaxbContext = JAXBContext.newInstance(OrderResponse.class);

Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();

return (OrderResponse) jaxbUnmarshaller.unmarshal(xmlStreamReader);

 

 


  • Hello @MLazarin161759 (Community Member)​,

     

    For this type of inquiry, I recommend contacting our technical support team. Please include the information in this post and any additional information or files that can assist the engineer reviewing the case.

     

    Here's how you can log a case:

    1. Navigate to the upper right corner of any page in the Community, and click on your user avatar.
    2. Select Contact Support from the drop-down menu. 

     

    Duncan,

    Application Security Consultant

    Expand Post

Topics (4)

No articles found
Loading

Ask the Community

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