Back to skill

Security audit

Academic Citation Manager

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed academic citation manager that uses local reference files and citation APIs in ways that fit its stated purpose, with some privacy and overwrite cautions.

Install only if you are comfortable with bibliographic lookups being sent to Crossref/Open Library and with references being stored locally. Avoid using untrusted custom config directories or changing api_base away from the default Crossref endpoint, and choose output/report paths carefully because existing files may be overwritten.

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
academic_citation_skill.py:510
Finding
Unvalidated Crossref API Base URL Enables Server-Side Request Forgery<![CDATA[ ## Vulnerability Details **File Location**: `academic_citation_skill.py:510-586` **Vulnerability Type**: Server-Side Request Forgery through an unvalidated configurable API endpoint **Risk Level**: Medium ### Vulnerable Code ```python def _load_config(self, config_file: str) -> Dict: """加载配置文件""" config_path = Path(__file__).parent / config_file try: with open(config_path, 'r', encoding='utf-8') as f: return json.load(f) except FileNotFoundError: return { "api_base": "https://api.crossref.org", "rate_limit": 10, "cache_ttl": 86400 } def fetch_by_doi(self, doi: str) -> Optional[Dict]: """通过DOI获取文献信息""" cache_key = f"doi_{doi}" if cache_key in self.cache: logger.info(f"Using cached result for DOI: {doi}") return self.cache[cache_key] self._rate_limit_wait() try: url = f"{self.config['api_base']}/works/{doi}" logger.info(f"Fetching DOI from: {url}") response = self.session.get(url, timeout=15) if response.status_code == 200: data = response.json() result = self._parse_crossref_response(data) self.cache[cache_key] = result logger.info(f"Successfully fetched reference: {result.get('title', 'Unknown')}") return result elif response.status_code == 404: logger.warning(f"DOI not found: {doi}") else: logger.error(f"Failed to fetch DOI {doi}: HTTP {response.status_code}") except requests.exceptions.Timeout: logger.error(f"Timeout fetching DOI: {doi}") except Exception as e: logger.error(f"Error fetching DOI {doi}: {str(e)}") return None def search_by_title_author(self, title: str, author: str = None, year: int = None, max_results: int = 10) -> List[Dict]: """通过标题和作者搜索文献""" self._rate_limit_wait() try: para ...[truncated 3385 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Allowlist the official service** - Permit only `https://api.crossref.org` unless custom providers are an explicit product requirement. - Compare normalized hostnames rather than using substring or suffix checks. 2. **Require secure URL properties** - Require the `https` scheme. - Reject embedded usernames or passwords. - Reject fragments and unexpected ports. - Normalize the URL before validation and use a URL-joining function rather than direct string concatenation. 3. **Block internal destinations** - Resolve all destination addresses before making a request. - Reject loopback, private, link-local, multicast, reserved, and unspecified IPv4 and IPv6 addresses. - Account for hosts that resolve to multiple addresses and DNS rebinding. 4. **Control redirects** - Prefer `allow_redirects=False`. - If redirects are necessary, validate the scheme, hostname, port, and resolved address of every redirect target before following it. 5. **Restrict custom configuration** - Require explicit user approval before enabling a nondefault API provider. - Treat configuration files from imported archives or untrusted project directories as untrusted input. - Fail closed when configuration parsing or endpoint validation fails. 6. **Reduce query disclosure** - Clearly notify users when search metadata will be sent to a nondefault provider. - Avoid logging full sensitive query strings where they are not operationally necessary. 7. **Add security tests** - Test rejection of `localhost`, `127.0.0.1`, `[::1]`, RFC1918 addresses, link-local addresses, cloud metadata addresses, embedded credentials, non-HTTPS schemes, unusual ports, and redirects to blocked networks. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared purpose focuses on adding and standardizing citations, but the documented behavior expands into batch import, local file processing, report generation, and maintaining a local reference database. That mismatch can mislead users into granting broader trust than warranted, and in an agent setting it may enable wider filesystem interaction and persistent data storage than expected from the short description.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The natural-language title, headings, and content are written entirely in Chinese and present the project summary in that locale without any indication of user choice or opt-in. Because this is a general project summary rather than a clearly region-specific compliance artifact, the file appears to enforce a specific language setting.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The file writes directly to a hard-coded absolute path using write mode, which will overwrite any existing file at that location without confirmation, backup, or visibility to the user. In an agent skill context, silent filesystem modification is risky because it can destroy user data or write outside the intended workspace if reused in another environment.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
This file contains user-facing natural-language content and comments in Chinese, including the generated project summary text, without indicating that users may choose another language. The policy explicitly flags language or locale constraints when a specific language is imposed without opt-in or documented justification.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill documentation describes capabilities that read local files, write output files, and access external network services, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization and transparency gap: an agent or reviewer cannot easily constrain execution to the minimum necessary privileges, increasing the risk of unintended file access, file modification, or network egress when the skill is invoked.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The module description is written entirely in Chinese for its functional guidance, which signals a fixed language/locale expectation rather than offering the user a choice. The policy for natural-language behavior requires avoiding forced language constraints unless they are explicitly optional or justified as region-specific.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The command-line description, examples, argument help text, and runtime prompts are presented only in Chinese. This creates a natural-language policy issue because the skill effectively mandates one language for use without presenting a user choice or documenting a justified region-specific limitation.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
This code performs a file write via open(output_file, 'w'), which can create or overwrite a local file. Although the CLI exposes a --report option, there is no confirmation prompt or explicit warning in the code comments/docstrings that using this option will modify the filesystem and may overwrite an existing report file.

Natural-Language Policy Violations

Medium
Confidence
84% confidence
Finding
The style alias mapping includes broad regional terms such as "uk", "commonwealth", "engineering", "medical", and "chinese", which can cause the system to infer a citation style from a user's nationality, language, or domain rather than from explicit user choice. In an academic citation tool, this can silently misapply formatting rules and produce incorrect or biased citation output, especially for multilingual or cross-disciplinary users.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
This JSON manifest/config applies to SQP-3, which covers natural-language policy violations in all file types. The setting `"default_language": "zh"` imposes a specific language by default, and the file does not indicate that users can choose their preferred language first or that the locale restriction is required for a region-specific purpose.

Missing User Warnings

Low
Confidence
88% confidence
Finding
The README explicitly advertises metadata retrieval from external services such as Crossref using DOI, ISBN, and title queries, but it does not warn users that their lookup terms and related bibliographic data will be transmitted off-host. In a research workflow, those queries can reveal unpublished paper topics, reading lists, or sensitive academic interests, so the omission creates a real but low-severity privacy/security issue.

Description-Behavior Mismatch

Low
Confidence
79% confidence
Finding
The manifest description focuses on adding real references and normalizing citation markers in research documents. The code goes beyond that narrow purpose by maintaining a standalone local database, tracking citation mappings, importing/exporting library data, and exposing library statistics, which are broader bibliography-management capabilities rather than document citation standardization itself.

Description-Behavior Mismatch

Low
Confidence
82% confidence
Finding
The manifest describes a citation helper for papers and theses, but the implementation also acts as a general reference conversion and data interchange tool by importing/exporting BibTeX and JSON files. Those are broader reference-management and data portability features not clearly implied by the stated purpose of adding references and standardizing in-document citations.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The file's natural-language interface, help text, log messages, and user-facing strings are entirely in Chinese, which effectively fixes the skill's language/locale behavior without opt-in or alternative selection. The policy requires either offering a language choice or clearly documenting and justifying a locale-specific constraint.

Static analysis

No suspicious patterns detected.