Back to skill

Security audit

arxiv-paper-resolver

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says: it fetches arXiv papers, saves local paper artifacts, and guides an agent to produce a Chinese Markdown document, with some hardening gaps but no evidence of deception or malicious behavior.

Install only if you want a Chinese-oriented arXiv paper workflow that downloads PDFs and writes extracted paper files locally. Prefer running it in a normal user account, choose an output directory intentionally, and consider pinning dependencies and adding PDF host/size validation before use in sensitive or internal-network environments.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/arxiv_section_extractor.py:303
Finding

Unvalidated Upstream PDF URL Allows Arbitrary Network Requests

Content
View full analysis

Vulnerability Details

File Location: scripts/arxiv_section_extractor.py, lines 75–78 and 303–309
Vulnerability Type: Unrestricted outbound request / potential SSRF
Risk Level: Medium

Vulnerable Code:

python
pdf_link = soup.find('a', {'class': 'download-pdf'})
if pdf_link and pdf_link.get('href'):
    href = pdf_link['href']
    links['pdf'] = f"https://arxiv.org{href}" if href.startswith('/') else href
python
try:
    pdf_resp = requests.get(access_links['pdf'], stream=True, timeout=60)
    pdf_resp.raise_for_status()
    with open(pdf_path, 'wb') as f:
        for chunk in pdf_resp.iter_content(8192):
            f.write(chunk)
except Exception as e:
    print(f"  PDF download failed: {e}")

Technical Analysis

The PDF URL is extracted from remotely supplied HTML. Relative links are assigned to arxiv.org, but absolute links are accepted without validating their scheme, hostname, port, or destination IP address. The subsequent requests.get() call also follows redirects by default without validating each redirect destination.

If the upstream HTML or HTTP redirect chain is compromised or manipulated, the script can be induced to send a request to an attacker-selected host. This includes public attacker infrastructure and, depending on the runner's network configuration, loopback, link-local, or internal network services.

The network activity is necessary for the declared paper-download functionality. However, permitting arbitrary destinations exceeds the minimum network privilege required, because the expected destination should be limited to trusted arXiv hosts.

Attack Path

  1. An attacker gains the ability to influence the arXiv HTML response, a trusted intermediary, or the redirect chain used for a paper download.
  2. The response supplies an absolute PDF URL targeting an attacker-controlled or internal endpoint.
  3. A user or Agent invokes the extractor f ...[truncated 807 chars]
Remediation
View remediation

Remediation Suggestions

  • Resolve relative links with urllib.parse.urljoin() against a trusted arXiv base URL.
  • Require HTTPS and allowlist the exact approved arXiv hostnames.
  • Reject URLs containing credentials, unexpected ports, fragments, or unsupported schemes.
  • Resolve the hostname and reject loopback, private, reserved, multicast, and link-local addresses.
  • Disable automatic redirects and validate every redirect target before following it.
  • Prefer constructing the expected PDF URL directly from the validated arXiv ID rather than trusting a link extracted from remote HTML.
  • Log rejected destinations without exposing sensitive URL components.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/arxiv_section_extractor.py:303
Finding

Unbounded PDF Download Can Exhaust Local Storage

Content
View full analysis

Vulnerability Details

File Location: scripts/arxiv_section_extractor.py, lines 303–309
Vulnerability Type: Unrestricted resource consumption
Risk Level: Low

Vulnerable Code:

python
try:
    pdf_resp = requests.get(access_links['pdf'], stream=True, timeout=60)
    pdf_resp.raise_for_status()
    with open(pdf_path, 'wb') as f:
        for chunk in pdf_resp.iter_content(8192):
            f.write(chunk)
except Exception as e:
    print(f"  PDF download failed: {e}")

Technical Analysis

Streaming the response limits memory consumption, but the loop writes until the remote server closes the response. The implementation does not enforce a maximum file size, validate the declared Content-Length, check the response content type, or verify a PDF signature.

The timeout does not provide a total download-duration or size limit. A server can continue providing data while satisfying socket-level timeout conditions. If the transfer fails, a partial file can remain at the final PDF path because the response is written directly to that location.

Attack Path

  1. A malicious, compromised, or abnormal PDF endpoint returns an extremely large or effectively unbounded response.
  2. The script accepts the response after checking only the HTTP status.
  3. The response is continuously written to the configured output filesystem.
  4. Available disk space or the user's storage quota is exhausted.
  5. Other applications may fail, and an incomplete file may remain under the expected .pdf filename.

Impact Assessment

The primary impact is denial of service through disk exhaustion. Damage is limited by the filesystem quota and the permissions of the process, but it may affect other applications sharing the same filesystem. The response is not executed by the script, so this finding does not independently provide code execution or privilege escalation.

Remediation
View remediation

Remediation Suggestions

  • Define a configurable maximum PDF size and stop the transfer once the limit is exceeded.
  • Reject a declared Content-Length greater than the configured limit.
  • Track actual bytes written because Content-Length may be missing or inaccurate.
  • Validate the expected content type and confirm that the downloaded file begins with a valid PDF signature.
  • Write downloads to a temporary file in the destination directory.
  • Delete the temporary file on every failure and atomically rename it only after successful validation.
  • Apply an overall transfer deadline in addition to connection and read timeouts.

T08 · Insecure Dependencies

Note
Location
scripts/requirements.txt:1
Finding

Dependencies Are Not Reproducibly Pinned

Content
View full analysis

Vulnerability Details

File Location: scripts/requirements.txt, lines 1–2
Vulnerability Type: Unbounded third-party dependency resolution
Risk Level: Low

Vulnerable Code:

text
requests>=2.28.0
beautifulsoup4>=4.11.0

Technical Analysis

The requirements specify minimum versions without upper bounds, exact versions, or integrity hashes. A future installation can therefore resolve package versions that were not reviewed with the Skill.

Both dependency names are legitimate, and the project does not configure a suspicious package index or demonstrate dependency confusion or typosquatting. This is consequently a supply-chain hardening issue rather than evidence that the current package intentionally installs malicious components.

Attack Path

  1. A user installs the dependencies at a later date.
  2. The package resolver selects newer transitive or direct dependency releases that were not reviewed by the Skill author.
  3. A selected release contains a vulnerability, incompatible behavior, or compromised code.
  4. The dependency's installation or runtime code executes with the privileges of the user running the installation or extractor.

Impact Assessment

A compromised dependency could theoretically execute code with the installing user's privileges and access files or network resources available to that user. The current files do not establish that such a compromised release exists, so the immediate risk is low. The confirmed issue is loss of build reproducibility and the inability to guarantee that future installations use audited dependency versions.

Remediation
View remediation

Remediation Suggestions

  • Pin direct and transitive dependencies to reviewed versions.
  • Generate a lock file or hashed requirements file using a controlled dependency-management tool.
  • Require package hashes during installation, such as through pip install --require-hashes.
  • Use the official Python Package Index over HTTPS and avoid untrusted extra indexes.
  • Run automated vulnerability and provenance checks during dependency updates.
  • Review and deliberately update pinned versions on a regular schedule rather than allowing unrestricted upgrades during installation.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

代码的大部分行为与声明相符:它确实处理 arXiv 论文、下载 PDF、解析 HTML 全文,并按论文章节结构输出文件与结构信息。但声明中的关键结果是“生成按论文自身章节结构编排的中文文档”,而代码实际上只提取并保存原始章节内容、摘要、结构总览和元数据,最后还明确把“翻译为中文 -> 组装中文文档”作为下一步,说明该脚本本身并不完成中文文档生成。因此存在实质性描述与行为不一致。输入方面代码还支持直接传入 arXiv ID,不过这属于能力扩展,次要于核心不匹配。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README describes generating Chinese documents as the default behavior, and the workflow later instructs the agent to translate chapters into Chinese. This is a natural-language locale policy issue because the skill mandates a specific language rather than letting the user choose or explicitly opt in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The sample workflow tells the agent to translate each section into Chinese as a standard step after extraction. Because no language preference is requested from the user in the example, this imposes a specific locale behavior contrary to the stated policy criteria.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill advertises behaviors that require network access, file writes, and use of environment-controlled paths, but it does not declare any explicit tool scope or permission boundaries. In an agent setting, this can lead to overbroad execution privileges, making it easier for the skill to fetch untrusted remote content and write it to user-controlled locations without clear authorization controls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description states the skill will generate a Chinese document as its output, which imposes a specific language by default. Under the policy, forcing a locale/language without user opt-in is a natural-language policy violation unless the constraint is explicitly justified or optional.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The markdown states that the tool automatically fetches arXiv HTML, downloads PDFs, and creates output directories/files. While these behaviors are part of the skill's purpose, the description does not clearly warn users that running it will perform network requests and persist multiple artifacts locally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file’s natural-language description presents the tool entirely as a Chinese-language extractor, and the end-to-end workflow explicitly targets translation into Chinese. There is no user choice or opt-in for language/locale behavior, which matches the policy category for forced language behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
99% confidence
Finding

The output message explicitly instructs the next step as translating each section into Chinese, which imposes a specific language workflow. Because no alternative language option or opt-in is provided, this is a natural-language locale/language policy issue.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency specification uses a lower-bound constraint without an upper bound or exact pin, which makes builds non-reproducible and can silently pull in future releases with breaking changes or newly introduced supply-chain risk. In a skill that fetches and parses remote arXiv content, dependency behavior matters because network and HTML parsing libraries sit on the trust boundary.

Content

Scanner excerpt · scripts/requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.28.0
beautifulsoup4>=4.11.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The manifest does not pin requests, and that package has multiple known advisories across versions, so the installed version could be vulnerable without any guarantee otherwise. This is more concerning here because the skill processes user-supplied URLs and performs outbound HTTP requests, making flaws in requests directly relevant to credential leakage, TLS/verification issues, or unsafe URL handling depending on the resolved version.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

beautifulsoup4 is also unpinned, so installs may resolve to different versions over time, reducing reproducibility and increasing supply-chain uncertainty. Because this skill parses attacker-controlled remote HTML/PDF-related content, parser-library changes can affect security posture and reliability.

Content

Scanner excerpt · scripts/requirements.txt (reported line 2)May include surrounding context.

text
requests>=2.28.0
beautifulsoup4>=4.11.0

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill file presents all headings, instructions, and FAQs in Chinese, which can amount to forcing a specific language for users without opt-in. The policy allows locale constraints when they are explicitly documented and justified, but no such justification or language-choice note appears here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file shows that the tool creates directories and downloads PDF/HTML content, which affects the local filesystem and performs network access. While the behavior is visible in the example output, the document does not include an explicit warning or disclosure section telling users that running the skill will write files locally and contact arXiv servers.

Content

No source excerpt is available for this finding.