subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: # HEAD check for status code result = subprocess.run( ["curl", "-s", "-o", "/dev/null", "-w", "%{http_code}", "--max-time", "8", "--location", url], capture_output=True, text=True, timeout=12- Confidence
- 92% confidence
- Finding
- The script passes a user/data-controlled URL directly to an external network client (curl) without constraining the scheme, host, or destination. Even though shell injection is avoided by using an argument list, this still enables server-side request forgery behavior: an attacker who can place a crafted job_url into jobs.csv can cause the archiver to make requests to internal services, localhost, cloud metadata endpoints, or other sensitive network targets during archive checks.
