mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
[dwdunwetter] Handle possible XXE injection (#15466)
XMLInputFactory: Disable properties IS_SUPPORTING_EXTERNAL_ENTITIES and SUPPORT_DTD which allow injecting external entities. Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
parent
5e1f24c54f
commit
d3c07344d3
@ -119,6 +119,8 @@ public class DwdWarningsData {
|
||||
|
||||
try {
|
||||
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
|
||||
inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
|
||||
inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
|
||||
XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(rawData));
|
||||
XMLEventReader eventReader = inputFactory.createXMLEventReader(reader);
|
||||
DwdWarningData gemeindeData = new DwdWarningData();
|
||||
|
Loading…
Reference in New Issue
Block a user