Skip to content

Commit 70ae316

Browse files
authored
Update vs.py
The original code may have had an XXE vulnerability, which is now fixed
1 parent 0c08453 commit 70ae316

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/vs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import xml.etree.ElementTree as etree
3232
from xml.etree.ElementTree import SubElement
33+
from defusedxml.ElementTree import parse
3334
from utils import _make_path_relative
3435
from utils import xml_indent
3536
fs_encoding = sys.getfilesystemencoding()
@@ -86,7 +87,8 @@ def VS_AddHeadFilesGroup(program, elem, project_path):
8687
def VSProject(target, script, program):
8788
project_path = os.path.dirname(os.path.abspath(target))
8889

89-
tree = etree.parse('template_vs2005.vcproj')
90+
# tree = etree.parse('template_vs2005.vcproj')
91+
tree = parse('template_vs2005.vcproj', forbid_dtd=True)
9092
root = tree.getroot()
9193

9294
out = open(target, 'w')

0 commit comments

Comments
 (0)