Back to skill

Security audit

Doc Genius

Security checks for vulnerabilities and agentic risk

Overview

This document tool is mostly coherent, but bundled scripts add under-disclosed external AI upload and billing behavior, including a hardcoded billing credential.

Review carefully before installing. Use only local mode for sensitive documents, avoid doc_processor_v2.py auto mode unless remote AI upload is intended, and do not use the paid processor until billing behavior is documented and the embedded billing credential is removed and rotated.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/doc_processor_paid.py:31
Finding

Hard-Coded Billing API Credential Exposed in Source Code

Content
View full analysis
float: """Query user balance.""" resp = requests.get( f"{BILLING_API_URL}/api/v1/billing/balance", params={"user_id": user_id}, headers={ 'X-API-Key': BILLING_API_KEY, 'Content-Type': 'application/json' } ) data = resp.json() return data.get('balance', 0.0) ``` ### Technical Analysis The source package contains a static API key that is reused as the `X-API-Key` credential for the external SkillPay service. Secrets embedded in distributed source code cannot be protected: every user, package mirror, log collector, or malicious local process with read access to the package can recover the credential. The same credential is used by the balance, charge, and payment-link endpoints. No per-installation credential, user-bound token, request signature, or server-side proxy separates untrusted clients from the privileged billing API. Whether the exposed key can read or modify all billing records depends on its server-side scope. However, the code demonstrates that it is accepted for both read and state-changing billing operations, making exposure security-significant even if some authorization checks exist on the server. ### Attack Path 1. An attacker downloads or otherwise reads the Skill package. 2. The attacker extracts `BILLING_API_URL`, `BILLING_API_KEY`, and `SKILL_ID` from `scripts/doc_processor_paid.py`. 3. The attacker constructs reques ...[truncated 1045 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/doc_processor_paid.py:41
Finding

Undisclosed External Billing Transmits User Identifiers and Modifies Remote Account State

Content
View full analysis
float: """Query user balance.""" resp = requests.get( f"{BILLING_API_URL}/api/v1/billing/balance", params={"user_id": user_id}, headers={ 'X-API-Key': BILLING_API_KEY, 'Content-Type': 'application/json' } ) data = resp.json() return data.get('balance', 0.0) def charge_user(user_id: str) -> dict: resp = requests.post( f"{BILLING_API_URL}/api/v1/billing/charge", json={ "user_id": user_id, "skill_id": SKILL_ID, "amount": 0 }, headers={ 'X-API-Key': BILLING_API_KEY, 'Content-Type': 'application/json' } ) data = resp.json() if data.get('success'): return { "ok": True, "balance": data.get('balance', 0) } else: return { "ok": False, "balance": data.get('balance', 0), "payment_url": data.get('payment_url', '') } def get_payment_link(user_id: str, amount: float = 8.0) -> str: """Generate a payment link.""" resp = requests.post( f"{BILLING_API_URL}/api/v1/billing/payment-link", json={ "user_id": user_id, "amount": amount }, headers={ 'X-API-Key': BILLING_API_KEY, 'Content-Type': 'application/json' } ) data = resp.json() return data.get('payment_url', '') ``` The summarization workflow invokes the state-changing operation before processing the document: ```python if args.command == 'summarize': if not args.skip_charge: charge_result = charge_user(args.user_id) if not charge ...[truncated 2820 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/doc_processor_v2.py:329
Finding

Default V2 Auto Mode Can Upload Document Content Without Explicit AI Selection

Content
View full analysis
Tuple[str, str]: if not self.openai_available: raise Exception("OpenAI is unavailable") try: client = openai.OpenAI() if len(text) > 10000: text = text[:10000] + "..." response = client.chat.completions.create( model=self.model, messages=[ { "role": "system", "content": "You are a professional document summarization assistant. Summarize the document accurately and concisely." }, { "role": "user", "content": f"Summarize the following document in no more than {max_words} words:\n\n{text}" } ], max_tokens=max_words * 2, temperature=0.3 ) return response.choices[0].message.content.strip(), "ai" except Exception as e: raise Exception(f"AI summarization failed: {e}") ``` Automatic mode prioritizes that remote path: ```python def summarize_with_fallback(self, text: str, method: str = "auto") -> Tuple[str, str]: if method == "ai": return self.summarize_ai(text) elif method == "textrank": return self.summarize_textrank(text) elif method == "fallback": return self.summarize_fallback(text) if self.method in ["auto", "ai"] and self.openai_available: try: ...[truncated 3114 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
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (23)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README advertises AI summarization via OpenAI API and instructs users to set an API key, but it does not clearly disclose that document contents may be transmitted to an external third-party service. This creates a real data-handling risk because users may process sensitive documents under the false assumption that all summarization is local.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list includes generic phrases like "文档处理", "智能摘要", and "format conversion" that could activate on many ordinary requests unrelated to this specific skill. Overbroad triggers can cause unintended invocation, increasing the chance that user files are processed or transformed when the user did not explicitly choose this tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
72% confidence
Finding

The manifest description and heading content are written in Chinese, which can effectively force a specific language experience if the broader environment does not explicitly target Chinese-speaking users. The file does not state that the skill is region-specific or offer an opt-in or alternative language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The conversion and batch-processing examples write outputs and reports to disk but do not warn about overwriting files, generating large numbers of derived files, or modifying user data locations. In a document-processing skill, this can lead to accidental data loss, clutter, or unintended writes when users run commands on valuable document folders.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The AI summary example tells users to set an OpenAI API key and process a document, but it does not warn that document contents may be transmitted to an external third-party API. This can cause accidental disclosure of sensitive or regulated data because users may assume the behavior matches the local summarization examples shown elsewhere in the file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The Python example programmatically sets an API key and invokes AI summarization without disclosing that the input document will leave the local environment. In a document-processing skill, that omission is more dangerous because users are likely to handle private business, legal, or personal files and may unknowingly send them to an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all user-facing documentation in Chinese and does not indicate that other languages are available or that Chinese is optional. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description and user-facing strings are written exclusively in Chinese, and the AI prompt instructs the model in Chinese without any option for user locale selection. This creates a natural-language locale constraint that is not presented as optional or justified as region-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

When method='ai', the code sends extracted document text to the OpenAI API via client.chat.completions.create(...). That creates an external data egress path for potentially sensitive document contents, and in an unknown skill context this is risky because PDFs, Word files, and Markdown may contain confidential or regulated data. The skill context makes this more dangerous because it is a general-purpose document processor, so users are likely to run it on private internal documents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The AI summarization path transmits raw document text in the user message payload without presenting an explicit warning or confirmation at the point of transmission. Users may believe they are only using a local document utility, yet the content is sent to an external provider, which can violate privacy expectations, data handling policies, or compliance requirements. In this skill context, that is especially concerning because the tool processes arbitrary user-supplied documents that may contain secrets or personal data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The docstring, CLI descriptions, prompts, and user-facing messages are written in Chinese, and the summarization prompt instructs responses in Chinese without offering any language choice. This creates a locale/language policy issue because the skill imposes a specific language rather than letting the user opt in or select a preferred language.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill is framed as a document-processing helper but embeds unrelated billing and payment-link generation capabilities, including remote account operations. More critically, it hardcodes a live billing API key in source, enabling anyone with code access to query balances, charge users, and generate payment links against the external billing service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
99% confidence
Finding

This network call performs an external billing charge operation using a hardcoded API key, transmitting user identifiers and invoking account-affecting behavior. If the embedded credential is abused, an attacker could perform unauthorized charges or manipulate billing operations through the third-party service.

Content

Scanner excerpt · scripts/doc_processor_paid.py (reported line 72)May include surrounding context.

python
"payment_url": "https://pay.bnbchain.org/..."
        }
    """
    resp = requests.post(
        f"{BILLING_API_URL}/api/v1/billing/charge",
        json={
            "user_id": user_id,

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

This external request generates payment links for users via the billing service, again using the same embedded API credential. Although lower impact than direct charging, unauthorized use could spam users, manipulate payment flows, or aid social engineering by producing attacker-triggered payment URLs.

Content

Scanner excerpt · scripts/doc_processor_paid.py (reported line 101)May include surrounding context.

python
def get_payment_link(user_id: str, amount: float = 8.0) -> str:
    """生成充值链接"""
    resp = requests.post(
        f"{BILLING_API_URL}/api/v1/billing/payment-link",
        json={
            "user_id": user_id,

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

When AI mode is selected, document contents are transmitted to OpenAI for summarization, which is an external data transfer not inherent to a purely local document utility. This can expose sensitive document contents to a third party, especially because the feature is integrated into the same processor and may be used on private files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The code sends raw document text to an external AI API when --method ai is chosen, but there is no explicit warning at the point of use that sensitive file contents will leave the local environment. Users may reasonably assume a document helper processes files locally unless clearly told otherwise, creating privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file-level description and user-facing strings present the tool as a Chinese-language assistant, and the AI system prompt instructs responses in Chinese. There is no indication that users can select another language or that the locale restriction is required for a region-specific purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

When AI summarization is enabled, the code sends raw document text to the OpenAI API, which may include sensitive or regulated content. The CLI does not provide an explicit warning, consent flow, or clear indication that document contents leave the local environment, creating a confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The system and user messages explicitly instruct the model to summarize using Chinese wording and a Chinese character-count limit. This imposes a language choice on all users regardless of document language and without any configurable locale option.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

该文件的标题、说明、输出示例和错误处理均以中文呈现,没有为用户提供语言选择或声明这是面向特定中文场景的专用文档。按语言/locale 政策,若技能强制特定语言而无用户选择或明确合理性说明,可构成自然语言策略问题。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The document consistently presents format conversion as a local operation performed by scripts/doc_processor.py or DocumentProcessor.convert, with no external service or credential requirement shown in the surrounding examples. The pricing section then states 格式转换 | $0.005/次 | 本地处理, which contradicts the described implementation/usage by implying a per-use charge for a local action.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

Earlier sections describe batch processing as local commands such as python3 scripts/doc_processor.py batch ... with options for output directories, reports, and worker concurrency. The pricing row 批量处理 | $0.003/文件 | 批量优惠 conflicts with that documented behavior because no external metered service or paid dependency is indicated for batch mode itself.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The entire skill document is written in Chinese and does not indicate that language selection is optional or region-specific. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.