T09 · Insecure Skill Coding Practices
- Location
code.md:25- Finding
Mandatory Contact Email Disclosure to Scraped Hosts
- Content
View full analysis
requests.Session: session = requests.Session() session.headers.update({ "User-Agent": f"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 (contact: {contact_email})", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.9", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive", }) return session ``` ### Technical Analysis The Skill instructs users to place a real contact email address in the `User-Agent` header. The session applies this header to every subsequent request, disclosing the address to target websites and potentially to redirected hosts, reverse proxies, content-delivery networks, analytics systems, and server-log processors. A personal email address is not technically required to fetch public content, enforce rate limits, or check `robots.txt`. Requiring it therefore exceeds the minimum data disclosure necessary for the declared scraping functionality. Reusing the same address across unrelated sites also provides a stable cross-site correlation identifier. ### Attack Path 1. A user supplies a personal or organizational email address to `create_session`. 2. The function embeds that address in the session-wide `User-Agent`. 3. The scraper requests a target URL or follows a redirect. 4. Each receiving infrastructure component can record the complete header. 5. A malicious site operator extracts the address and uses it for tracking, profiling, spam, or targe ...[truncated 420 chars]- Remediation
View remediation
