Reputation: 71
I'm writing a rest endpoint using spring boot which accepts reqeuest body as xml. Added dependency as jackson-dataformat-xml. I want prevent SSRF by ignoring dtd processing, xxe etc. How can I configure my application for this.
I see by default below configured for XMLMapper but still it processes doctype
xmlIn.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); // and ditto wrt [dataformat-xml#211], SUPPORT_DTD xmlIn.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
Upvotes: 0
Views: 30