{"id":500,"cve":"CVE-2020-10799","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2020-10799","cwe":"CWE-611 Improper Restriction of XML External Entity Reference","cwe_number":611,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/611","cvss_score":9.8,"published":"2020-03-20","owasp":"A06 Vulnerable and Outdated Components","odc":"Function","cdc":"Incorrect Functionality","category":"Input Validation and Sanitization","subcategory":"Insecure Parsing or Deserialization","scope":"Remote","impact":"Information Disclosure","summary":"SVGlib (through 0.9.3) in Python is vulnerable to XXE attacks via svg2rlg","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2020-10799\/","description":"The svglib package through 0.9.3 for Python allows XXE attacks via an svg2rlg call.","solution":"Update svglib to version 0.9.4 or higher.","affected_component":"svglib","fixed_by_upgrading":true,"vulnerable_code":"import xml.etree.ElementTree as ET\n\ndef unsafe_svg2rlg(svg_data):\n    # This code does not disable DTDs, making it vulnerable to XXE attacks\n    root = ET.fromstring(svg_data)\n    # Process the root element and convert to RLG (this part is hypothetical)\n    return convert_svg_to_rlg(root)\n\ndef convert_svg_to_rlg(root):\n    # Placeholder function for converting SVG to RLG\n    pass","patched_code":"import xml.etree.ElementTree as ET\n\ndef safe_svg2rlg(svg_data):\n    # Disable DTDs to prevent XXE attacks\n    parser = ET.XMLParser(resolve_entities=False)\n    root = ET.fromstring(svg_data, parser=parser)\n    # Process the root element and convert to RLG (this part is hypothetical)\n    return convert_svg_to_rlg(root)\n\ndef convert_svg_to_rlg(root):\n    # Placeholder function for converting SVG to RLG\n    pass","payload_needed":false,"payload":null,"payload_status":"none","published_fix":[{"repository":"deeplook\/svglib","commit_url":"https:\/\/github.com\/deeplook\/svglib\/commit\/35686a130ed260c71a382a8f83d41fd31a46704d","commit_subject":"Fixes #229 - External entity loading disabled by default","units":[{"file":"svglib\/svglib.py","function":"load_svg_file"},{"file":"svglib\/svglib.py","function":"svg2rlg"}]}],"references":null}