Back to skill

Security audit

MentorForge.skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent research-mentor builder, but its helper scripts fetch arbitrary URLs, use environment API keys, and persist/export local content in ways that deserve review.

Review before installing or running in a sensitive environment. Use the scripts only on trusted public scholar pages and trusted publication indexes, avoid --allow-insecure-ssl, avoid storing API keys in environment variables unless reports are kept private, and do not export packages that may contain symlinks or sensitive local files.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/collect_publications.py:477
Finding

<![CDATA[Unrestricted homepage requests enable server-side request forgery]]>

Content
View full analysis
bytes | None: request_headers = {"User-Agent": DEFAULT_UA} if headers: request_headers.update(headers) last_error = None for attempt in range(retries): try: req = urllib.request.Request(url, headers=request_headers) with urllib.request.urlopen(req, timeout=timeout, context=SSL_CONTEXT) as response: if log: final_url = response.geturl() if final_url not in log.fetched_urls: log.fetched_urls.append(final_url) return response.read() ``` ```python def collect_from_homepage(args: argparse.Namespace, log: FetchLog) -> list[dict[str, Any]]: if not args.homepage: return [] homepage = args.homepage first_html = request_text(homepage, timeout=args.timeout, log=log) if not first_html: return [] pages = discover_homepage_pages(homepage, first_html, args.max_homepage_pages) page_html = {homepage: first_html} pubs: list[dict[str, Any]] = [] for page in pages: html_text = page_html.get(page) if html_text is None: html_text = request_text(page, timeout=args.timeout, log=log) ``` ### Technical Analysis The user-controlled `--homepage` value is passed directly to `urllib.request.urlopen`. The implementation does not restrict the URL scheme to secure web requests, resolve and validate the destination address, block private or link-local networks, or revalidate redirect destinations. Although discovered secondary pages are limited to ...[truncated 1533 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/recover_pdfs.py:48
Finding

<![CDATA[Publication-index URLs enable SSRF through the PDF recovery utility]]>

Content
View full analysis
str | None: for key in ["pdf_url", "pdf", "open_pdf_url"]: value = record.get(key) if isinstance(value, str) and value.startswith(("http://", "https://")): return value links = record.get("links") if isinstance(links, dict): for key in ["pdf", "PDF"]: value = links.get(key) if isinstance(value, str) and value.startswith(("http://", "https://")): return value return None def download_pdf(url: str, dest: Path, timeout: int, allow_insecure: bool) -> tuple[bool, str]: if dest.exists() and dest.stat().st_size > 5000: return True, f"already exists: {dest.stat().st_size} bytes" request = urllib.request.Request( url, headers={ "User-Agent": "Mozilla/5.0 MentorForge/0.2", "Accept": "application/pdf,*/*", }, ) try: with urllib.request.urlopen(request, timeout=timeout, context=ssl_context(allow_insecure)) as response: payload = response.read() ``` ```python future_map = { pool.submit(download_pdf, url, dest, args.timeout, args.allow_insecure_ssl): (record, url, dest) for _i, record, url, dest in jobs } ``` ### Technical Analysis The recovery utility treats any string beginning with `http://` or `https://` in a supplied publication index as a valid PDF destination. It does not enforce a public-address policy, constrain destinations to trusted publication providers, or inspect redirect targets. The subsequent check that the response resembles a PDF does not prevent SSRF. A malicious internal endpoint can return PDF-like bytes, and even a rejected response still causes the prohibited network r ...[truncated 1016 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/collect_publications.py:566
Finding

<![CDATA[OpenAlex API key can be exposed in warnings and generated reports]]>

Content
View full analysis
`. 3. The request fails because of a server error, timeout, TLS failure, rate limit, or attacker-induced netw ...[truncated 638 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/recover_pdfs.py:65
Finding

<![CDATA[PDF recovery performs unbounded in-memory downloads and does not enforce the successful-download limit]]>

Content
View full analysis
tuple[bool, str]: if dest.exists() and dest.stat().st_size > 5000: return True, f"already exists: {dest.stat().st_size} bytes" request = urllib.request.Request( url, headers={ "User-Agent": "Mozilla/5.0 MentorForge/0.2", "Accept": "application/pdf,*/*", }, ) try: with urllib.request.urlopen(request, timeout=timeout, context=ssl_context(allow_insecure)) as response: payload = response.read() except urllib.error.HTTPError as exc: return False, f"HTTP {exc.code}" except Exception as exc: return False, f"{type(exc).__name__}: {exc}" if len(payload) < 5000: return False, f"too small: {len(payload)} bytes" if not payload[:2048].lstrip().startswith(b"%PDF"): return False, "response is not a PDF" dest.parent.mkdir(parents=True, exist_ok=True) dest.write_bytes(payload) ``` ```python with ThreadPoolExecutor(max_workers=max(1, args.workers)) as pool: future_map = { pool.submit(download_pdf, url, dest, args.timeout, args.allow_insecure_ssl): (record, url, dest) for _i, record, url, dest in jobs } for future in as_completed(future_map): record, url, dest = future_map[future] ok, status = future.result() if ok: record["local_pdf"] = str(dest) successes += 1 attempts.append((record, url, ok, status, dest)) if already + successes >= args.max_pdfs: # Let already submitted jobs finish; do not schedule more. pass ``` ### Technical Analysis `response.read()` buffers the entire res ...[truncated 1259 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/export_skill_package.py:11
Finding

<![CDATA[Package export can dereference symlinks and copy files outside the Skill directory]]>

Content
View full analysis
None: dest.mkdir(parents=True, exist_ok=True) for item in src.iterdir(): target = dest / item.name if item.is_dir(): shutil.copytree(item, target, dirs_exist_ok=True) else: shutil.copy2(item, target) ``` ### Technical Analysis The exporter recursively copies every item from a supplied Skill package without rejecting symbolic links or verifying that each resolved source remains beneath the resolved Skill root. `shutil.copy2` follows symbolic links by default. `shutil.copytree` also follows linked content under its default behavior rather than preserving links as isolated metadata. Therefore, a generated or attacker-provided Skill package can contain a link to a file or directory outside the package and cause that external content to be copied into an export. This violates the expected package boundary and can unintentionally include host files in artifacts intended for sharing. ### Attack Path 1. An attacker supplies or modifies a Skill directory. 2. The attacker adds a symbolic link inside the directory that points to a sensitive host file or directory. 3. A user invokes `export_skill_package.py` on that directory. 4. `copy_package` treats the link as an ordinary file or traversable directory. 5. The target content is copied into one or more export formats. 6. The user distributes or uploads the exported package, unintentionally disclosing the copied data. ### Impact Assessment The exporter can read any file accessible to its operating-system account and place that content into the export directory. The vulnerability does not elevate operating-system privileges, but it can cross the intended Skill-directory boundary and disclos ...[truncated 83 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises a capability centered on analyzing academic evidence sources and constructing or evaluating an evidence-grounded mentor skill. The supplied code does none of that. Instead, it operates purely as a local export tool for an already-existing skill package, transforming/copying files into different output formats. While this may be part of a larger toolchain around mentor skills, this specific code chunk’s primary purpose is packaging/export, not distillation of researchers into mentor skills. Therefore the description does not accurately represent the behavior of this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description centers on synthesizing or validating a mentor/persona skill from academic evidence sources. The actual code does not analyze researchers, extract methodology, model worldview, or build/critique mentor interactions. Instead, it performs PDF recovery for publication records: selecting candidate PDF URLs, fetching files over HTTP(S), validating PDF signatures, saving them locally, and producing updated index/report artifacts. While PDFs are mentioned in the description as possible inputs, this code only acquires them and does not implement the declared higher-level mentor-skill functionality. That is a materially different primary purpose, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad skill for creating and refining evidence-grounded cyber mentor skills from academic sources. The actual code only validates the completeness and consistency of a MentorForge-generated skill package. While 'validate' is mentioned in the description, the code's scope is much narrower: it verifies required files, manifest fields, naming/version rules, and minimum evidence counts. It does not carry out the central declared function of distilling a researcher into a mentor skill, nor does it analyze academic materials. Therefore the description materially overstates and mischaracterizes the code's actual primary purpose.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
- `SKILL.md`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 48)May include surrounding context.

md
- `SKILL.md`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 200)May include surrounding context.

md
- `SKILL.md`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 210)May include surrounding context.

md
- `SKILL.md`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill instructs the agent to use filesystem, environment, and network-capable scripts but does not declare any explicit tool scope or permission boundaries. That creates an overbroad execution surface where a runtime may allow more access than intended, increasing the chance of unexpected file writes, external requests, or environment-variable exposure during normal use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Line L245 instructs the skill to write the user-facing report in Chinese for Chinese users unless they ask otherwise. This is a natural-language locale policy constraint applied by default based on the user's identity/group rather than an explicit opt-in, which falls under language or locale policy violations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Lines L044-L046 require SKILL.md YAML frontmatter to be ASCII-only and explicitly forbid Chinese and other non-ASCII characters. This is a language/locale policy constraint expressed in natural language, and the file does not offer users a choice or opt-in mechanism for localized names/descriptions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template's skill description is broad enough to match many ordinary research-help requests, which can cause the mentor skill to activate in contexts beyond scholar-distillation or evidence-grounded mentorship. Over-broad invocation increases the chance of inappropriate routing, persona overreach, and responses framed as authoritative scholar-specific guidance when the user only wanted generic research assistance.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The default prompt encourages invocation for generic idea critique and improvement tasks without requiring explicit scholar selection, evidence context, or mentor-distillation intent. In practice this can make the skill a catch-all research assistant trigger, increasing accidental activation and causing the model to apply a scholar-persona framing where it may be misleading or not user-intended.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/collect_publications.py (reported line 573)May include surrounding context.

python
params["mailto"] = mailto
    if api_key:
        params["api_key"] = api_key
    search_url = "https://api.openalex.org/authors?" + urllib.parse.urlencode(params)
    data = request_json(search_url, timeout=args.timeout, log=log)
    if not data:
        return []

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/collect_publications.py (reported line 616)May include surrounding context.

python
params["mailto"] = mailto
    if api_key:
        params["api_key"] = api_key
    search_url = "https://api.openalex.org/authors?" + urllib.parse.urlencode(params)
    data = request_json(search_url, timeout=args.timeout, log=log)
    if not data:
        return []

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/collect_publications.py (reported line 708)May include surrounding context.

python
"fields": author_fields,
            "limit": 10,
        }
        url = "https://api.semanticscholar.org/graph/v1/author/search?" + urllib.parse.urlencode(params)
        data = request_json(url, headers=headers, timeout=args.timeout, retries=2, log=log)
        authors = (data or {}).get("data") or []
    if not authors:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/collect_publications.py (reported line 735)May include surrounding context.

python
"fields": author_fields,
            "limit": 10,
        }
        url = "https://api.semanticscholar.org/graph/v1/author/search?" + urllib.parse.urlencode(params)
        data = request_json(url, headers=headers, timeout=args.timeout, retries=2, log=log)
        authors = (data or {}).get("data") or []
    if not authors:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/collect_publications.py (reported line 806)May include surrounding context.

python
params = {"query.bibliographic": title, "rows": 1}
        if mailto:
            params["mailto"] = mailto
        url = "https://api.crossref.org/works?" + urllib.parse.urlencode(params)
        data = request_json(url, timeout=args.timeout, retries=2, log=log)
        items = ((data or {}).get("message") or {}).get("items") or []
        if not items:

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The --allow-insecure-ssl option disables HTTPS certificate verification globally via an unverified SSL context, allowing man-in-the-middle attackers to intercept or tamper with metadata and downloaded PDFs. In this skill, the script collects evidence used for mentor distillation, so tampered remote content could poison downstream outputs and any local corpus built from downloaded files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script extracts full PDF text and associated metadata, then writes multiple markdown and JSON artifacts to disk by default. In a research-distillation workflow, users may supply locally available but still sensitive documents, so silently persisting full text, file paths, URLs, and metadata can create unintended data retention and secondary disclosure risks if the output directory is shared, synced, or later ingested by other tools.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This collector's stated purpose is to gather public publication metadata and open PDFs from academic sources. Accessing local environment variables for OPENALEX_API_KEY, OPENALEX_MAILTO, SEMANTIC_SCHOLAR_API_KEY, and CROSSREF_MAILTO adds credential/configuration access beyond straightforward public-source retrieval, and the manifest does not mention environment-variable access as part of the skill's scope.

Content

No source excerpt is available for this finding.