Back to skill

Security audit

ai-paper-researcher

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently searches arXiv and saves selected PDFs locally, with disclosed but not risk-free network and file-write behavior.

Before installing, be aware that using this skill can contact arXiv, download PDFs, and create or append files in a local paper_list library. Prefer a controlled workspace, monitor disk usage for large downloads, and consider pinning dependencies before installation.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
README.md:59
Finding
Unpinned Third-Party Dependencies## Vulnerability Details **File Location**: `README.md:59-63`; equivalent instructions at `README_zh-CN.md:61-65` **Vulnerability Type**: Supply-chain risk from unconstrained dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash pip install arxiv requests ``` ### Technical Analysis The documented installation command retrieves the latest available versions of the `arxiv` and `requests` packages without version constraints or package hashes. Consequently, the source code that users install may differ from the code reviewed and tested by the project maintainers. If a dependency release, maintainer account, or package distribution channel is compromised, following these instructions could install attacker-controlled package code. Python packages may execute code during installation, and imported dependency modules execute within the context of `arxiv_tool.py`. This finding does not establish that either named dependency is currently malicious. The risk arises from the absence of version pinning and integrity verification. ### Attack Path 1. An attacker compromises a dependency's publishing account, release pipeline, or distribution artifact. 2. The attacker publishes a malicious release under the legitimate package name. 3. A user follows the project documentation and runs `pip install arxiv requests`. 4. Package resolution selects the affected latest release because no reviewed version is pinned. 5. Malicious code executes during installation or when `arxiv_tool.py` imports the package. ### Impact Assessment Successfully exploited dependency compromise could execute arbitrary code with the privileges of the user running `pip` or the tool. This may permit access to that user's readable files, modification of writable files, outbound network communication, credential theft from the process environment, or further compromise within the same privilege boundary. The project itself does not request ele ...[truncated 95 chars]
Remediation
## Remediation Suggestions 1. Add a reviewed dependency file with exact versions, for example: ```text arxiv==<reviewed-version> requests==<reviewed-version> ``` 2. Generate and verify cryptographic hashes for all direct and transitive dependencies. 3. Install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Use a lock-file workflow and review dependency changes before updating locked versions. 5. Document the expected package index explicitly and avoid untrusted extra indexes. 6. Add automated dependency vulnerability and provenance checks to the release process. 7. Update both English and Chinese installation documentation to use the secured installation procedure.

T09 · Insecure Skill Coding Practices

Warning
Location
arxiv_tool.py:101
Finding
Unbounded and Insufficiently Validated PDF Download## Vulnerability Details **File Location**: `arxiv_tool.py:101-133` **Vulnerability Type**: Untrusted network response written without origin, content, or size enforcement **Risk Level**: Medium ### Vulnerable Code ```python pdf_url = paper.pdf_url if not pdf_url.endswith('.pdf'): pdf_url += '.pdf' headers = { 'User-Agent': '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' } max_retries = 3 for attempt in range(max_retries): time.sleep(3) response = requests.get(pdf_url, stream=True, timeout=60, headers=headers) if response.status_code == 429: if attempt < max_retries - 1: wait_time = (attempt + 1) * 10 print(f"A 429 rate limit has been triggered. We will wait {wait_time} seconds before attempting the {attempt + 2}th retry...") time.sleep(wait_time) continue else: response.raise_for_status() else: response.raise_for_status() break filepath = os.path.join(WORKSPACE_DIR, filename) with open(filepath, 'wb') as f: for chunk in response.iter_content(chunk_size=8192): if chunk: f.write(chunk) ``` ### Technical Analysis The downloader trusts `paper.pdf_url` obtained through upstream paper metadata and passes it directly to `requests.get`. The request follows redirects by default, but the code does not enforce an HTTPS scheme, restrict the initial or redirected hostname to an approved arXiv domain, or inspect the final URL. The implementation also does not validate the response `Content-Type`, PDF file signature, declared `Content-Length`, or cumulative bytes written. The `timeout=60` value controls socket operations but does not impose a maximum total response size. A server that continues delivering data can therefore cause the application to write an unexpec ...[truncated 1850 chars]
Remediation
## Remediation Suggestions 1. Parse the URL before requesting it and require HTTPS. 2. Restrict the hostname to an explicit allowlist of expected arXiv download domains. 3. Disable automatic redirects or validate the scheme and hostname of every redirect target before following it. 4. Require an expected PDF media type and verify that the downloaded content begins with a valid PDF signature. 5. Define a conservative maximum PDF size. Reject responses whose `Content-Length` exceeds it. 6. Track cumulative bytes during streaming and abort once the maximum is exceeded, even if `Content-Length` is absent or incorrect. 7. Download into a temporary file in the destination directory, validate it, and atomically rename it only after successful completion. 8. Remove partial files on validation failures, size-limit violations, timeouts, and other exceptions. 9. Apply separate connection and read timeouts and, where practical, a total download-duration limit. 10. Close responses deterministically by using a context manager around `requests.get`.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (4)

Missing User Warnings

Medium
Confidence
89% confidence
Finding
该 README 明确鼓励用户通过自然语言让技能“直接下载”论文并自动写入本地工作区,但没有告知会创建/修改哪些文件、保存到哪里、如何避免覆盖或误下载,也没有要求确认步骤。对于具备文件系统访问能力的 Agent 技能,这种缺少数据影响提示和显式确认的设计会增加非预期写盘、工作区污染和用户误操作风险。

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill explicitly automates PDF downloads and local CSV/file persistence in the workspace without requiring user confirmation or warning about side effects. In an agent setting, this can cause unintended writes, storage consumption, and network-triggered downloads based solely on a natural-language request, which is risky even if the functionality is aligned with the skill’s purpose.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The file presents itself as a local-file-system-only assistant, but it performs outbound network access via the arxiv client and direct HTTP requests to download PDFs. This mismatch is dangerous because users, reviewers, or policy gates may trust it as offline-only and permit execution in contexts where network egress is restricted, enabling unintended data flow and bypass of expected security boundaries.

Missing User Warnings

Low
Confidence
91% confidence
Finding
The README explicitly advertises that the skill will 'silently download PDFs' and maintain local CSV state, but it does not clearly warn users that invoking the skill causes filesystem writes in the workspace. In an agent setting, undisclosed side effects reduce user consent and can lead to unintended storage consumption or modification of local files, even if the writes are limited to the declared paper library area.

Static analysis

No suspicious patterns detected.