Back to skill

Security audit

专利初稿撰写 · PatentMax

Security checks for vulnerabilities and agentic risk

Overview

The skill largely matches its patent-drafting purpose, but it uploads sensitive invention materials and an API key to a remote service with limited data-handling detail and an unconstrained endpoint override.

Install only if you are allowed to send the invention materials to PatentMax. Verify PATENTMAX_BASE_URL is unset or points to the legitimate PatentMax endpoint, review PatentMax's confidentiality and retention terms, and avoid submitting trade secrets, unfiled core parameters, export-controlled data, or customer confidential material without approval.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (28)

Tainted flow: 'req' from os.environ.get (line 221, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/patentmax_disclosure.py (reported line 145)May include surrounding context.

python
req.add_header("Content-Type", "application/json")
    req.add_header("Accept", "application/json")
    try:
        with urllib.request.urlopen(req, timeout=30) as response:
            payload = json.loads(response.read().decode("utf-8"))
    except urllib.error.HTTPError as exc:
        _, message = _server_error(exc.read().decode("utf-8", "replace"))

Tainted flow: 'req' from os.environ.get (line 221, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The generic request() function sends patent materials and the Authorization bearer token to a URL built from PATENTMAX_BASE_URL, which is taken from the environment without host validation. If an attacker controls that environment variable, they can redirect requests to an arbitrary server and capture highly sensitive disclosure content and API credentials.

Content

Scanner excerpt · scripts/patentmax_disclosure.py (reported line 230)May include surrounding context.

python
req.add_header(key, value)

    try:
        with urllib.request.urlopen(req, timeout=TIMEOUT) as response:
            payload = response.read()
            return payload if raw else json.loads(payload.decode("utf-8"))
    except urllib.error.HTTPError as exc:

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README instructs users to upload invention disclosures, R&D reports, and technical方案 to an external API, but it does not clearly warn that these materials may contain trade secrets, unpublished inventions, export-controlled information, or other highly sensitive IP. In a patent-drafting workflow, omission of explicit privacy, retention, and data-handling disclosures materially increases the chance of unintended disclosure before users can assess legal and business risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

整体上,代码与声明的主线用途高度相关,确实是在调用 PatentMax 服务生成专利方向分析和专利初稿文档,不存在明显无关或恶意能力。但按照“描述是否准确代表代码实际行为”的标准,仍有实质性不一致。最明显的是密钥机制:声明明确写了 Requires a PatentMax API key,而代码中 TRIAL_SOURCE/ensure_api_key 机制表明设计上支持在未配置正式密钥时自动领取免费试用密钥并继续使用,只是当前常量设置使该路径默认关闭;这意味着代码能力与声明不完全一致。其次,代码并非仅做‘专利初稿生成’,它还实现了完整的异步任务生命周期管理(提交、轮询、状态、下载、取消、预览)以及“想法→方向分析→选定方向→生成专利”的两阶段流程。虽然这些可被视为主功能的配套实现,但其中“方向分析”是被代码明确实现的核心报告类型,不只是边缘细节。再者,代码支持 .pptx 解析,这在声明中未体现。综上,主目的基本一致,但描述未完整准确覆盖若干重要能力与资源使用方式,因此应判定为存在描述与行为不完全匹配。

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The script has clear network capability and transmits uploaded disclosure materials, generated metadata, and API credentials to a remote PatentMax service, yet the finding indicates this capability is not covered by declared permissions. In a skill ecosystem, undeclared network access is dangerous because it can silently export confidential IP materials outside the local environment.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The script has clear network capability and transmits uploaded disclosure materials, generated metadata, and API credentials to a remote PatentMax service, yet the finding indicates this capability is not covered by declared permissions. In a skill ecosystem, undeclared network access is dangerous because it can silently export confidential IP materials outside the local environment.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The skill explicitly directs use of an external endpoint and API key for processing uploaded patent materials, which constitutes external transmission of potentially confidential technical documents. External transmission is not inherently malicious, but in this skill's context the data is unusually sensitive because pre-filing invention disclosures can lose secrecy value or create serious IP exposure if mishandled.

Content

Scanner excerpt · README.md (reported line 63)May include surrounding context.

怎么用

在 api.ip930.com 创建密钥,设成环境变量:

bash
export PATENTMAX_API_KEY="pm_live_你的密钥"

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The invocation guidance is broad enough to match common requests like '帮我把这个写成专利' or '生成专利初稿', which can cause the skill to activate on sensitive R&D materials with minimal user friction. In this context, overbroad routing is risky because the skill sends confidential invention disclosures to an external patent-drafting service, so accidental activation could expose trade secrets or unpublished patentable subject matter.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description states '所用模型全部国产,国外模型 0 使用' / 'All models are made in China; no foreign models are used' as a fixed constraint. This is a locale/vendor-origin restriction presented as mandatory behavior, with no user choice or documented compliance rationale, which fits the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown again states that all models used are domestic and foreign models are never used. Repeating a fixed regional/model-origin limitation without offering user choice or explaining a justified regional compliance need is a natural-language policy issue under the provided rule.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/faq.md (reported line 7)May include surrounding context.

md
| 现象 | 处理 |
| --- | --- |
| `未设置 API 密钥` | `export PATENTMAX_API_KEY=pm_live_xxx`,密钥在 https://api.ip930.com/features/api-platform 创建 |
| `HTTP 401` | 密钥无效或已撤销,到控制台重新创建 |
| `HTTP 402` | 余额不足,到控制台充值 |
| `HTTP 400` | 材料少于 20 字或超过 10 万字;`ideas` 的方向数只能是 1 到 5 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/faq.md (reported line 74)May include surrounding context.

md
| 现象 | 处理 |
| --- | --- |
| `未设置 API 密钥` | `export PATENTMAX_API_KEY=pm_live_xxx`,密钥在 https://api.ip930.com/features/api-platform 创建 |
| `HTTP 401` | 密钥无效或已撤销,到控制台重新创建 |
| `HTTP 402` | 余额不足,到控制台充值 |
| `HTTP 400` | 材料少于 20 字或超过 10 万字;`ideas` 的方向数只能是 1 到 5 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/faq.md (reported line 78)May include surrounding context.

md
| 现象 | 处理 |
| --- | --- |
| `未设置 API 密钥` | `export PATENTMAX_API_KEY=pm_live_xxx`,密钥在 https://api.ip930.com/features/api-platform 创建 |
| `HTTP 401` | 密钥无效或已撤销,到控制台重新创建 |
| `HTTP 402` | 余额不足,到控制台充值 |
| `HTTP 400` | 材料少于 20 字或超过 10 万字;`ideas` 的方向数只能是 1 到 5 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/faq.md (reported line 82)May include surrounding context.

md
| 现象 | 处理 |
| --- | --- |
| `未设置 API 密钥` | `export PATENTMAX_API_KEY=pm_live_xxx`,密钥在 https://api.ip930.com/features/api-platform 创建 |
| `HTTP 401` | 密钥无效或已撤销,到控制台重新创建 |
| `HTTP 402` | 余额不足,到控制台充值 |
| `HTTP 400` | 材料少于 20 字或超过 10 万字;`ideas` 的方向数只能是 1 到 5 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/faq.md (reported line 84)May include surrounding context.

md
| 现象 | 处理 |
| --- | --- |
| `未设置 API 密钥` | `export PATENTMAX_API_KEY=pm_live_xxx`,密钥在 https://api.ip930.com/features/api-platform 创建 |
| `HTTP 401` | 密钥无效或已撤销,到控制台重新创建 |
| `HTTP 402` | 余额不足,到控制台充值 |
| `HTTP 400` | 材料少于 20 字或超过 10 万字;`ideas` 的方向数只能是 1 到 5 |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The FAQ provides direct curl examples that send patent drafts, technical disclosures, and related sensitive IP materials to a third-party remote API, but it gives no warning about confidentiality, retention, jurisdiction, or data-handling practices. In the context of patent drafting, this omission is meaningful because premature or unvetted disclosure of invention details can create legal, contractual, or trade-secret risks for users.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The referenced domain is part of a command that uploads sensitive patent content to a remote service. In this context, the danger is not the domain mention alone but the documented workflow of transmitting proprietary invention disclosures without adjacent security guidance.

Content

Scanner excerpt · references/faq.md (reported line 59)May include surrounding context.

bash
# 提交初稿
curl -s -X POST "https://api.ip930.com/api/v1/reports" \
  -H "Authorization: Bearer $PATENTMAX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 任取一个唯一串" \

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The referenced domain is part of a command that uploads sensitive patent content to a remote service. In this context, the danger is not the domain mention alone but the documented workflow of transmitting proprietary invention disclosures without adjacent security guidance.

Content

Scanner excerpt · references/faq.md (reported line 59)May include surrounding context.

bash
# 提交初稿
curl -s -X POST "https://api.ip930.com/api/v1/reports" \
  -H "Authorization: Bearer $PATENTMAX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 任取一个唯一串" \

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

This example sends raw idea text to a third-party endpoint to generate patent directions. Because early-stage idea disclosures can still be commercially sensitive and may affect trade-secret handling, the lack of privacy/contextual warnings makes this a genuine security concern.

Content

Scanner excerpt · references/faq.md (reported line 66)May include surrounding context.

md
-d '{"report_type":"technical_disclosure","input":{"supplement":"材料正文……","title_hint":"案件名称"}}'

# 出方向
curl -s -X POST "https://api.ip930.com/api/v1/reports" \
  -H "Authorization: Bearer $PATENTMAX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 任取一个唯一串" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The guide discloses that materials are sent to the server and that the pipeline may automatically fill in missing technical details, but it does not present this inferred-content behavior as a clear, prominent risk requiring explicit user acknowledgment. In a patent-drafting context, silently inferred or fabricated implementation details can introduce inaccurate technical statements, unintended disclosure, or invalid claim support, creating legal and confidentiality risks for users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

A language or locale policy issue exists when a skill effectively forces a specific language without user opt-in. This workflow is entirely presented in Chinese and does not state that the user may choose another language or that the skill is intentionally restricted to a Chinese-language context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and subsequent user-facing messages instruct that errors and progress should be shown in Chinese, and the code consistently emits only Chinese text. This creates a language/locale policy issue because the skill does not provide user opt-in, fallback, or any documented justification for restricting interaction to Chinese.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/patentmax_disclosure.py (reported line 11)May include surrounding context.

python
**每条命令最多跑 30 秒就返回。** WorkBuddy 这类宿主前台跑命令时,要等命令结束才显示输出,
AI 中途也插不了话;一条命令阻塞十几分钟,用户就十几分钟什么都看不到,宿主还可能把命令掐掉。
所以 create / ideas 提交后只等 15 秒就先返回,之后用 wait 接着等,每次最多 30 秒:

    退出码 0   这一步有结果了(wait 完成时已自动下载好 Word)
    退出码 10  还在生成:把输出里的「[进度]」行告诉用户,再运行一次 wait

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/patentmax_disclosure.py (reported line 11)May include surrounding context.

python
**每条命令最多跑 30 秒就返回。** WorkBuddy 这类宿主前台跑命令时,要等命令结束才显示输出,
AI 中途也插不了话;一条命令阻塞十几分钟,用户就十几分钟什么都看不到,宿主还可能把命令掐掉。
所以 create / ideas 提交后只等 15 秒就先返回,之后用 wait 接着等,每次最多 30 秒:

    退出码 0   这一步有结果了(wait 完成时已自动下载好 Word)
    退出码 10  还在生成:把输出里的「[进度]」行告诉用户,再运行一次 wait

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

This tool is explicitly designed to communicate with an external PatentMax service, including trial-key registration and subsequent report generation. Because the skill handles sensitive patent disclosures, external transmission materially increases confidentiality risk: user-uploaded invention details leave the local environment and are processed by a third party.

Content

Scanner excerpt · scripts/patentmax_disclosure.py (reported line 103)May include surrounding context.

python
# 密钥版(TRIAL_SOURCE 为空):必须设 PATENTMAX_API_KEY,不领试用。
TRIAL_SOURCE = ""
TRIAL_GROUP = "disclosure"
TRIAL_REGISTER_URL = "https://api.ip930.com/features/api-platform"
KEY_FROM_TRIAL = False