{"id":651,"cve":"CVE-2017-7235","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2017-7235","cwe":"CWE-20 Improper Input Validation","cwe_number":20,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/20","cvss_score":8.8,"published":"2017-03-23","owasp":"A06 Vulnerable and Outdated Components","odc":"Function","cdc":"Incorrect Functionality","category":"Input Validation and Sanitization","subcategory":"Command Injection","scope":"Remote","impact":"Arbitrary Code Execution","summary":"Cloudflare-scrape 1.6.6 to 1.7.1 allows malicious sites to execute Python code on user's scrapers","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2017-7235\/","description":"An issue was discovered in cloudflare-scrape 1.6.6 through 1.7.1. A malicious website owner could craft a page that executes arbitrary Python code against any cfscrape user who scrapes that website. This is fixed in 1.8.0.","solution":"Update cloudflare-scrape to version 1.8.0 or higher.","affected_component":"cloudflare-scrape","fixed_by_upgrading":true,"vulnerable_code":"import cfscrape\n\n# Example of a vulnerable implementation that could execute arbitrary code\nscraper = cfscrape.create_scraper()  # Create a scraper instance\n\nurl = \"http:\/\/example.com\"  # Replace with a malicious target URL\nresponse = scraper.get(url)\n\n# Vulnerable code that could execute arbitrary Python code from the response\nexec(response.text)  # This is where the vulnerability lies","patched_code":"import cfscrape\n\n# Example of a fixed implementation that avoids executing arbitrary code\nscraper = cfscrape.create_scraper()  # Create a scraper instance\n\n# Instead of executing arbitrary code, we ensure to only fetch the response\nurl = \"http:\/\/example.com\"  # Replace with the target URL\nresponse = scraper.get(url)\n\n# Process the response safely\nprint(response.text)","payload_needed":false,"payload":null,"payload_status":"none","published_fix":[],"references":null}