{"id":529,"cve":"CVE-2017-16763","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2017-16763","cwe":"CWE-91: XML Injection","cwe_number":91,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/91","cvss_score":9.8,"published":"2017-11-10","owasp":"A03 Injection","odc":"Function","cdc":"Incorrect Functionality","category":"Input Validation and Sanitization","subcategory":"Insecure Parsing or Deserialization","scope":"Local","impact":"Arbitrary Code Execution","summary":"YAML parsing vulnerability in Confire 0.2.0 enables arbitrary Python command execution through \"~\/.confire.yaml\"","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2017-16763\/","description":"An exploitable vulnerability exists in the YAML parsing functionality in config.py in Confire 0.2.0. Due to the user-specific configuration being loaded from \"~\/.confire.yaml\" using the yaml.load function, a YAML parser can execute arbitrary Python commands resulting in command execution. An attacker can insert Python into loaded YAML to trigger this vulnerability.","solution":"Update Confire to version 0.2.1 or higher.","affected_component":"PyYAML","fixed_by_upgrading":true,"vulnerable_code":"import yaml\n\ndef load_config(file_path):\n    with open(file_path, 'r') as file:\n        # Using yaml.load which is unsafe and can execute arbitrary code\n        config = yaml.load(file, Loader=yaml.FullLoader)\n    return config\n\nconfig = load_config('~\/.confire.yaml')","patched_code":"import yaml\n\ndef load_config(file_path):\n    with open(file_path, 'r') as file:\n        # Use safe_load instead of load to prevent execution of arbitrary Python code\n        config = yaml.safe_load(file)\n    return config\n\nconfig = load_config('~\/.confire.yaml')","payload_needed":false,"payload":null,"payload_status":"none","published_fix":[{"repository":"bbengfort\/confire","commit_url":"https:\/\/github.com\/bbengfort\/confire\/commit\/8cc86a5ec2327e070f1d576d61bbaadf861597ea","commit_subject":"use safe load instead of load","units":[{"file":"confire\/config.py","function":"Configuration.load"}]}],"references":null}