Skip to content

Commit 79df485

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

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/vs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import xml.etree.ElementTree as etree
3232
from xml.etree.ElementTree import SubElement
3333
from defusedxml.ElementTree import parse
34+
from defusedxml.common import DefusedXmlException
3435
from utils import _make_path_relative
3536
from utils import xml_indent
3637
fs_encoding = sys.getfilesystemencoding()
@@ -88,7 +89,7 @@ def VSProject(target, script, program):
8889
project_path = os.path.dirname(os.path.abspath(target))
8990

9091
# tree = etree.parse('template_vs2005.vcproj')
91-
tree = parse('template_vs2005.vcproj', forbid_dtd=True)
92+
tree = parse('template_vs2005.vcproj', forbid_dtd=False, forbid_external=True)
9293
root = tree.getroot()
9394

9495
out = open(target, 'w')

0 commit comments

Comments
 (0)