Fix potential security risk when using Spring OXM
Disable by default external entity resolution when using Spring OXM with jaxb. This prevents a XML entity from being able to resolve a local file on the host system. See: https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing Issue: SPR-10806
This commit is contained in:
parent
28be8e9063
commit
7576274874
|
|
@ -226,7 +226,9 @@ public class Jaxb2CollectionHttpMessageConverter<T extends Collection>
|
|||
* @return the created factory
|
||||
*/
|
||||
protected XMLInputFactory createXmlInputFactory() {
|
||||
return XMLInputFactory.newInstance();
|
||||
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
|
||||
inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false);
|
||||
return inputFactory;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue