Skip to content

Commit 9658ce2

Browse files
fix: ensure network and load_dtd are disabled in xml reading
1 parent 3eca2f1 commit 9658ce2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • src/dve/core_engine/backends/readers

‎src/dve/core_engine/backends/readers/xml.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ def _get_elements_from_stream(self, stream: IO[bytes]) -> Iterator[XMLElement]:
255255
remove_comments=True,
256256
dtd_validation=False,
257257
resolve_entities=False,
258+
no_network=True,
259+
load_dtd=False,
258260
)
259261

260262
tree: etree._ElementTree = etree.parse(stream, parser)
@@ -375,6 +377,8 @@ def _get_elements_from_stream(self, stream: IO[bytes]) -> Iterator[XMLElement]:
375377
remove_comments=True,
376378
dtd_validation=False,
377379
resolve_entities=False,
380+
no_network=True,
381+
load_dtd=False,
378382
)
379383

380384
container_contexts = 1 if not self.root_tag else 0

0 commit comments

Comments
 (0)