SonarOpenCommunity / sonar-cxx

Use of an insecure method from xml.etree.ElementTree detected BAN-B314
Security
Major
5 months ago3 years old
Using xml.etree.ElementTree.parse to parse untrusted XML data is known to be vulnerable to XML attacks. Replace xml.etree.ElementTree.parse with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called
106    keys = []
107    keys_to_ruleelement = {}    
108    try :
109        tree = et.parse(path)    110    except et.ParseError as e:
111        sys.stderr.write("[ERROR] {}: {}\n".format(path, e))
112        return keys, keys_to_ruleelement