Back to skill

Security audit

Arxiv Watcher

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent arXiv paper watcher with limited local bookmarking, but it should treat fetched paper metadata as untrusted content.

Install only if you are comfortable with the skill fetching arXiv data over the network and saving starred paper metadata locally. Treat paper titles, abstracts, authors, and links shown by the skill as untrusted external content, and avoid following suspicious links or treating metadata text as instructions.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/arxiv_watcher.py:23
Finding
ArXiv API Responses Are Retrieved over Unencrypted HTTP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/arxiv_watcher.py:23`, with request sinks at `scripts/arxiv_watcher.py:68-74` and `scripts/arxiv_watcher.py:125-143` **Vulnerability Type**: Unauthenticated plaintext network communication **Risk Level**: Medium ### Vulnerable Code ```python # ArXiv API endpoints ARXIV_API_URL = "http://export.arxiv.org/api/query" ARXIV_NEW_URL = "https://arxiv.org/list/{category}/new" ``` The plaintext endpoint is used to retrieve individual paper details: ```python params = {"id_list": clean_id} url = f"{ARXIV_API_URL}?" + "&".join(f"{k}={v}" for k, v in params.items()) try: req = urllib.request.Request(url, headers={"User-Agent": "ArXiv-Watcher/1.0"}) with urllib.request.urlopen(req, timeout=30) as response: xml_content = response.read().decode("utf-8") except urllib.error.URLError as e: return None ``` It is also used to retrieve category feeds: ```python url = f"{ARXIV_API_URL}?" + "&".join(f"{k}={v}" for k, v in params.items()) try: req = urllib.request.Request(url, headers={"User-Agent": "ArXiv-Watcher/1.0"}) with urllib.request.urlopen(req, timeout=30) as response: xml_content = response.read().decode("utf-8") except urllib.error.URLError as e: print(f"Error fetching papers: {e}", file=sys.stderr) return [] ``` ### Technical Analysis `ARXIV_API_URL` uses HTTP rather than HTTPS. Consequently, the client does not receive transport-layer confidentiality, server authentication, or response integrity. Any actor capable of intercepting network traffic—such as a malicious access point, compromised proxy, or on-path network operator—can inspect and alter the Atom response. The modified XML is parsed without cryptographic verification. Attacker-controlled titles, abstracts, authors, identifiers, categories, and URLs can therefore be accepted as legitimate arXiv metadata. These values are subsequently rendered in Markdown and can also be written to `assets/starred.j ...[truncated 1286 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the endpoint with an HTTPS URL supported by the service: ```python ARXIV_API_URL = "https://export.arxiv.org/api/query" ``` 2. Prevent downgrade attacks by rejecting redirects whose destination does not use HTTPS. A custom redirect handler can enforce an `https` scheme for every redirect target. 3. Retain normal TLS certificate and hostname verification; do not introduce an unverified SSL context. 4. Treat transport or TLS failures as hard failures rather than falling back to plaintext HTTP. 5. Validate response content type, enforce a reasonable maximum response size, and catch XML parsing errors. 6. Sanitize and validate remote metadata independently, because TLS protects transport integrity but does not make paper-submitter content inherently trustworthy. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/arxiv_watcher.py:151
Finding
Untrusted Feed Metadata Is Rendered as Markdown and Persisted Without Sanitization<![CDATA[ ## Vulnerability Details **File Location**: `scripts/arxiv_watcher.py:82-109`, `scripts/arxiv_watcher.py:151-205`, and `scripts/arxiv_watcher.py:228-251` **Vulnerability Type**: Untrusted content injection into agent-facing Markdown and persistent storage **Risk Level**: Medium ### Vulnerable Code Remote feed fields are accepted directly: ```python # Extract title title_elem = entry.find(f"{{{ATOM_NS}}}title") if title_elem is not None: paper["title"] = title_elem.text.strip().replace("\n", " ") # Extract authors authors = [] for author in entry.findall(f"{{{ATOM_NS}}}author"): name_elem = author.find(f"{{{ATOM_NS}}}name") if name_elem is not None: authors.append(name_elem.text) paper["authors"] = authors # Extract summary summary_elem = entry.find(f"{{{ATOM_NS}}}summary") if summary_elem is not None: abstract = summary_elem.text.strip().replace("\n", " ") paper["abstract"] = abstract paper["abstract_preview"] = abstract[:200] + "..." if len(abstract) > 200 else abstract ``` The values are interpolated directly into Markdown: ```python def format_paper_markdown(paper: dict, is_starred: bool = False) -> str: """Format a paper as Markdown.""" star = "⭐ " if is_starred else "" lines = [ f"## {star}[{paper.get('id', 'N/A')}] {paper.get('title', 'No title')}", "", f"**Authors:** {', '.join(paper.get('authors', []))}", f"**Category:** {paper.get('category', 'N/A')}", f"**Submitted:** {paper.get('published', 'N/A')}", "", f"**Abstract:**", paper.get('abstract_preview', 'No abstract available'), "", "**Links:**", f"- arXiv: {paper.get('url', 'N/A')}", f"- PDF: {paper.get('pdf_url', 'N/A')}", "", "---", "" ] return "\n".join(lines) ``` Fetched metadata can then be persisted: ```python else: paper["starred_at"] = datetime.now().isoformat() starred[arxiv_id] = paper save_starr ...[truncated 2428 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Escape Markdown control characters in every externally sourced textual field before rendering, including backslashes, brackets, parentheses, backticks, asterisks, underscores, hash characters, angle brackets, and pipe characters. 2. Strip or encode embedded HTML rather than passing it to Markdown renderers. 3. Construct arXiv and PDF links locally from validated identifiers instead of trusting feed-provided URLs. 4. Strictly validate modern and legacy arXiv identifiers and reject arbitrary fallback strings. For example, use anchored allowlisted patterns rather than returning an unmatched input unchanged. 5. Validate categories against the expected arXiv category syntax or an explicit allowlist. 6. Apply maximum lengths and safe character policies to titles, author names, abstracts, categories, and URLs. 7. Delimit paper metadata clearly as untrusted quoted data when supplying it to an AI agent. The agent should be instructed not to treat text inside metadata fields as commands. 8. Store normalized, validated values in `starred.json`; do not persist raw feed fields that failed validation. 9. When reading existing starred data, validate its schema and value types before sorting or rendering it. 10. Combine these controls with HTTPS transport so network attackers cannot freely replace the feed before validation. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger list includes broad natural-language phrases such as "check arxiv," "new papers," and especially "latest papers on," which are common expressions that may appear in ordinary conversation. This can cause unintended invocation of the skill, leading the agent to fetch external content or alter reading-list state when the user did not explicitly intend to use this skill.

Missing User Warnings

Low
Confidence
89% confidence
Finding
This code creates and writes to assets/starred.json, which persists user-selected paper metadata on disk. Although the behavior is part of the 'star' feature, the file-writing side effect is not disclosed in a user-facing warning or confirmation near the operation.

Static analysis

No suspicious patterns detected.