T09 · Insecure Skill Coding Practices
Warning
- Location
- src/scholar_research/search.py:15
- Finding
- Academic Search Queries Transmitted over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `src/scholar_research/search.py:15, 80-84` **Vulnerability Type**: Plaintext transmission of user-provided search terms **Risk Level**: Medium ### Vulnerable Code ```python SOURCES = { "arxiv": { "base_url": "http://export.arxiv.org/api/query", "search_field": "all", "max_results": 50 }, ``` ```python response = requests.get( SOURCES["arxiv"]["base_url"], params=params, timeout=60 ) ``` The same plaintext endpoint is documented at `references/apis.md:6`: ```markdown - **Base URL**: `http://export.arxiv.org/api/query` ``` ### Technical Analysis The arXiv integration sends the user-provided research query to an API endpoint using unencrypted HTTP. Query parameters, including potentially confidential research interests, are visible to network intermediaries. Because HTTP provides neither transport confidentiality nor server authentication, an on-path attacker can also modify the API response. Network access is necessary for the declared academic-search functionality, but plaintext transport exceeds neither a valid functional requirement nor minimum safe privileges. The other enabled search services already use HTTPS. This is not evidence of intentional exfiltration: the destination is the legitimate arXiv service. It is nevertheless an exploitable confidentiality and integrity flaw. ### Attack Path 1. A user submits a sensitive academic search query. 2. `search_arxiv()` places the query in the `search_query` URL parameter. 3. The request is transmitted to `http://export.arxiv.org/api/query`. 4. An attacker controlling or observing the local network, proxy, gateway, or upstream route reads the query. 5. The attacker may modify the returned XML before it reaches the Skill. 6. Manipulated paper metadata may subsequently be parsed, scored, and presented as legitimate search results. ### Impact Assessment An attacker can obtain the contents of arXiv search quer ...[truncated 322 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Replace the endpoint with `https://export.arxiv.org/api/query`. - Require HTTPS for every configured source. - Reject redirects that downgrade from HTTPS to HTTP. - Validate each redirect destination before following it. - Add a regression test asserting that all production API endpoints use HTTPS. - Document that user search terms are transmitted to third-party academic services. ]]>
