subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: # 使用百度搜索查询企业简称 search_query = f"{company_name} 简称" result = subprocess.run( ['curl', '-s', '-A', 'Mozilla/5.0', '-L', f'https://www.baidu.com/s?wd={search_query}'], capture_output=True, text=True, timeout=10- Confidence
- 90% confidence
- Finding
- The code launches an external network client (`curl`) and sends company names to Baidu as part of normal processing. Although it avoids shell injection by passing an argument list to `subprocess.run`, it still creates an unnecessary outbound data flow and expands the attack surface by depending on an external executable and remote content.
