subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
"""CDP 打开新 tab,返回 page_id""" try: req_url = f'http://localhost:9222/json/new?{url}' r = subprocess.run( ['curl', '-s', '-X', 'PUT', req_url], capture_output=True, text=True, timeout=15 )- Confidence
- 86% confidence
- Finding
- This call constructs a CDP management URL by concatenating an unencoded URL into http://localhost:9222/json/new?{url}. Although subprocess is called safely without a shell, an attacker controlling job_id or the target URL could inject query/control characters and cause unintended requests to the locally exposed Chrome DevTools interface, which can open arbitrary pages and broaden browser automation scope.
