VAITP Dataset

← Back to the dataset

CVE-2017-7235

Cloudflare-scrape 1.6.6 to 1.7.1 allows malicious sites to execute Python code on user's scrapers

  • CVSS 8.8
  • CWE-20 Improper Input Validation
  • Input Validation and Sanitization
  • Remote

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.

CVSS base score
8.8
Published
2017-03-23
OWASP
A06 Vulnerable and Outdated Components
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
cloudflare-scrape
Fixed by upgrading
Yes

Solution

Update cloudflare-scrape to version 1.8.0 or higher.

Vulnerable code sample

import cfscrape

# Example of a vulnerable implementation that could execute arbitrary code
scraper = cfscrape.create_scraper()  # Create a scraper instance

url = "http://example.com"  # Replace with a malicious target URL
response = scraper.get(url)

# Vulnerable code that could execute arbitrary Python code from the response
exec(response.text)  # This is where the vulnerability lies

Patched code sample

import cfscrape

# Example of a fixed implementation that avoids executing arbitrary code
scraper = cfscrape.create_scraper()  # Create a scraper instance

# Instead of executing arbitrary code, we ensure to only fetch the response
url = "http://example.com"  # Replace with the target URL
response = scraper.get(url)

# Process the response safely
print(response.text)

Cite this entry

@misc{vaitp:cve20177235,
  title        = {{Cloudflare-scrape 1.6.6 to 1.7.1 allows malicious sites to execute Python code on user's scrapers}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2017},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2017-7235},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2017-7235/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.