T09 · Insecure Skill Coding Practices
- Location
scripts/arxiv_client.py:9- Finding
Plaintext arXiv API Request Allows Metadata Tampering Before Publication
- Content
View full analysis
list[dict[str, Any]]: params = urllib.parse.urlencode( { "search_query": f"cat:{category}", "start": start, "max_results": max_results, "sortBy": "submittedDate", "sortOrder": "descending", } ) url = f"{ARXIV_API}?{params}" with urllib.request.urlopen(url, timeout=60) as response: payload = response.read() root = ET.fromstring(payload) ``` ### Technical Analysis The arXiv API endpoint is configured with an `http://` URL. Consequently, the initial request is not protected by TLS. Even if the server normally redirects clients to HTTPS, an attacker positioned on the network can intercept the original HTTP request and return an arbitrary response or malicious redirect before a secure connection is established. The returned Atom document is parsed without validating its origin, transport security, content type, or maximum response size. Paper titles, abstracts, identifiers, authors, and categories from this response subsequently influence keyword matching and are incorporated into generated notes and Xiaohongshu post content. The retrieved material is treated as data rather than executable code, so this does not provide direct local code execution. Nevertheless, it creates a content-integrity vulnerability in a workflow capable of publishing externally supplied information. ### Attack Path 1. A user runs `scripts/run_daily.py` on a network controlled or observable by an attacker. 2. The Skill sends a plaintext HTTP request to `export.arxiv.org`. 3. The attacker intercepts th ...[truncated 1220 chars]- Remediation
View remediation
