{"id":1140,"cve":"CVE-2024-27320","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2024-27320\/","cwe":"CWE-1236","cwe_number":1236,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/1236","cvss_score":7.8,"published":"2024-09-12","owasp":"A03 Injection","odc":"Function","cdc":"Incorrect Functionality","category":"Input Validation and Sanitization","subcategory":"Insecure Parsing or Deserialization","scope":"Remote","impact":"Arbitrary Code Execution","summary":"Arbitrary code execution in Refuel Autolabel via malicious CSV files.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2024-27320\/","description":"An arbitrary code execution vulnerability exists in versions 0.0.8 and newer of the Refuel Autolabel library because of the way its classification tasks handle provided CSV files. If a victim user creates a classification task using a maliciously crafted CSV file containing Python code, the code will be passed to an eval function which executes it.","solution":"Upgrade to version 0.0.9 or newer and avoid using eval on untrusted input.","affected_component":"Refuel Autolabel","fixed_by_upgrading":true,"vulnerable_code":"import csv\n\ndef process_csv(file_path):\n    \"\"\"Vulnerable function that demonstrates the security issue.\"\"\"\n    with open(file_path, 'r') as csvfile:\n        reader = csv.reader(csvfile)\n        for row in reader:\n            expression = row[0]\n            result = eval(expression)\n            print(result)\n","patched_code":"import csv\nimport ast\n\ndef process_csv(file_path):\n    \"\"\"Secure function that fixes the vulnerability.\"\"\"\n    # SECURE: This version prevents command injection\n    with open(file_path, 'r') as csvfile:\n        reader = csv.reader(csvfile)\n        for row in reader:\n            expression = row[0]\n            result = ast.literal_eval(expression)\n            print(result)","payload_needed":true,"payload":"```csv\n\"__import__('os').system('whoami')\"\n```","payload_status":"available","published_fix":[],"references":null}