Tainted flow: 'req' from os.environ.get (line 68, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 96% confidence
- Finding
Sending SEC_USER_AGENT to the SEC is intentional and appropriate for this research workflow, and the value is not inherently a credential. However, the destination check uses the substring "sec.gov" anywhere in the URL, so an attacker-controlled URL such as https://attacker.example/sec.gov can receive the configured name and email address; redirects can also forward this header to an unintended destination.
- Content
python else: ua = BROWSER_UA req = urllib.request.Request(src, headers={"User-Agent": ua, "Accept": "*/*"}) with urllib.request.urlopen(req, timeout=90) as r: dst.write_bytes(r.read()) return dst
