T09 · Insecure Skill Coding Practices
- Location
scripts/arxiv_api.py:14- Finding
Plaintext HTTP Exposes arXiv Queries and Permits Response Tampering
- Content
View full analysis
Vulnerability Details
File Location:
scripts/arxiv_api.py, lines 14-95
Vulnerability Type: Unencrypted network communication
Risk Level: MediumVulnerable Code
python ARXIV_API = "http://export.arxiv.org/api/query" ARXIV_NS = "{http://www.w3.org/2005/Atom}"python params = { "search_query": query, "start": str(start), "max_results": str(min(max_results, 100)), "sortBy": sort_by, "sortOrder": sort_order, } url = f"{ARXIV_API}?{urllib.parse.urlencode(params)}" time.sleep(0.5) req = urllib.request.Request( url, headers={"User-Agent": "LiteratureSearchSkill/1.0"} ) with urllib.request.urlopen(req, timeout=30) as resp: data = resp.read().decode("utf-8")Technical Analysis
The arXiv client transmits the complete search request over plaintext HTTP. The query is placed in the URL query string and sent without TLS confidentiality or server authentication.
An attacker with an on-path network position can:
- Observe potentially sensitive research queries.
- Modify the returned Atom document.
- Substitute paper titles, abstracts, authors, DOI values, and links.
- Inject attacker-controlled content into downstream search and summarization output.
This transport is not required by the Skill's declared functionality. The arXiv service can be accessed using HTTPS, so plaintext HTTP exceeds neither a functional necessity nor a least-privilege requirement.
Attack Path
- A user invokes
scripts/search.pywith arXiv enabled. arxiv_api.search()constructs an HTTP URL containing the user's search query.- An attacker able to observe or alter network traffic intercepts the plaintext request.
- The attacker reads the query or returns a modified Atom response.
- The client parses the response without any authenticated transport guarantee.
- Forged metadata is normalized and shown to the user or passed into `gener ...[truncated 603 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace the endpoint with the HTTPS version:
python ARXIV_API = "https://export.arxiv.org/api/query" -
Preserve Python's default TLS certificate and hostname verification.
-
Do not add handlers that accept invalid certificates.
-
Reject redirects that downgrade the request from HTTPS to HTTP.
-
Add a regression test confirming that the configured endpoint uses the
httpsscheme. -
Treat all returned metadata as untrusted even after TLS protection, because publishers and upstream records may still contain hostile text.
-
