Back to skill

Security audit

llm-researcher

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed LLM research-report helper with expected network, PDF parsing, local report generation, and bounded cleanup behavior, though users should be careful with the temporary folder cleanup and third-party PDF parsing.

Install only if you are comfortable using MinerU to parse public arXiv PDF URLs and giving the agent network, Python, MINERU_API_KEY, and local write access. Before running it, make sure any tmp_llm_research folder in the working directory is disposable, because the workflow deletes that folder after writing the final report.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:119
Finding

Predictable Recursive Workspace Deletion

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 119
Vulnerability Type: Unsafe temporary workspace cleanup
Risk Level: Medium

Vulnerable Code

markdown
- Clean up `tmp_llm_research` only after the final Markdown report has been successfully written, to avoid affecting the final aggregation.

The associated cleanup instruction also appears at line 104:

markdown
After the final report is successfully written, delete the entire `tmp_llm_research` folder.

Technical Analysis

The skill directs the agent to recursively delete a fixed, relative directory named tmp_llm_research. It does not require the directory to be uniquely created for the current execution, verify its resolved path, reject symbolic links, establish ownership with a marker, or restrict deletion to files generated during the current run.

Because the directory name is predictable and interpreted relative to the execution environment, it may already contain unrelated user data. An attacker with write access to the working directory could also prepare this path or influence where it resolves before the skill runs. Once report generation succeeds, the cleanup step may recursively remove content that the skill did not create.

This is an unsafe temporary-file and cleanup practice rather than evidence of deliberate malicious behavior.

Attack Path

  1. The victim runs the skill in a directory where tmp_llm_research already exists, or an attacker with local write access prepares that predictable path.
  2. The existing directory contains unrelated files or is arranged to resolve to content outside the intended per-run workspace.
  3. The skill processes entries and successfully writes its final report.
  4. The cleanup instruction is triggered.
  5. The agent recursively deletes the entire tmp_llm_research directory rather than deleting only artifacts created during the current run.

Impact Assessment

Successful exploitation can cause deletion of files av ...[truncated 366 chars]

Remediation
View remediation

Remediation Suggestions

  1. Create a unique workspace for every run using a secure temporary-directory facility rather than the fixed tmp_llm_research name.
  2. Store the workspace's canonical absolute path immediately after creation.
  3. Create an ownership marker containing a random run identifier and require that marker to match before cleanup.
  4. Before deletion, resolve the path and verify that it remains beneath an explicitly approved temporary root.
  5. Reject symbolic links and refuse cleanup if the workspace path, any relevant parent, or the ownership marker has changed unexpectedly.
  6. Track generated artifacts and delete only those files where possible instead of recursively deleting an entire directory.
  7. Use cleanup APIs that do not follow symbolic links and operate on trusted directory handles where the platform supports them.
  8. If any validation fails, preserve the directory and report a cleanup warning rather than attempting deletion.
  9. Update both cleanup directives in SKILL.md so the workflow consistently applies these safeguards.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented purpose frames the skill as a research/classification helper, but the implementation also requires external API use, shell-based PDF processing, remote content retrieval, and local file generation. This mismatch is dangerous because reviewers and users may grant trust or permissions based on the benign description while the skill actually performs higher-risk operations that expand the attack surface and can expose data to third-party services.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill requires environment access, shell execution, and file writes but does not declare any explicit tool scope or allowed-tools constraints. That leaves the runtime with broader-than-necessary capabilities, increasing the chance that prompt-influenced behavior could invoke sensitive operations such as reading secrets, executing commands, or writing files beyond the intended workflow.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/pdf_to_md.py (reported line 87)May include surrounding context.

python
cmd.extend(["--data-raw", json.dumps(payload)])
    cmd.append(url)
    try:
        completed = subprocess.run(
            cmd,
            capture_output=True,
            check=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/pdf_to_md.py (reported line 106)May include surrounding context.

python
cmd.extend(["--data-raw", json.dumps(payload)])
    cmd.append(url)
    try:
        completed = subprocess.run(
            cmd,
            capture_output=True,
            check=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script sends user-supplied PDF URLs to the third-party MinerU extraction service, which may expose sensitive document locations or proprietary content to an external provider without an explicit warning or consent checkpoint. In a research skill, users may pass internal preprints, private storage links, or signed URLs, so this data-sharing behavior is more dangerous than in a purely public-data workflow.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The top-level documentation states the script returns extracted markdown content from the '# Introduction' section, implying that is the only output behavior. However, argument parsing supports '--range all' and main() skips introduction extraction in that mode, so the script may output the entire markdown instead.

Content

No source excerpt is available for this finding.