diff --git a/test-requirements.txt b/test-requirements.txt index bb2fc0421b..1f808c2f37 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,3 +4,4 @@ paramiko pytest==8.3.4 pytest-asyncio==0.25.0 pytest-mock==3.14.0 +defusedxml==0.7.1 diff --git a/tests/end_to_end/utils/summary_helper.py b/tests/end_to_end/utils/summary_helper.py index a832a281c7..25b29ad9fd 100644 --- a/tests/end_to_end/utils/summary_helper.py +++ b/tests/end_to_end/utils/summary_helper.py @@ -1,7 +1,7 @@ # Copyright 2020-2023 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -import xml.etree.ElementTree as ET +from defusedxml.ElementTree import parse as defused_parse from lxml import etree import os from pathlib import Path @@ -17,7 +17,7 @@ print(f"Results XML file not found at {result_xml}. Exiting...") exit(1) -tree = ET.parse(result_xml, parser=parser) +tree = defused_parse(result_xml, parser=parser) # Get the root element testsuites = tree.getroot()