Back to skill

Security audit

技术交底书 · PatentMax

Security checks for vulnerabilities and agentic risk

Overview

The patent-writing workflow is coherent, but its credential storage and authenticated network requests need review before use.

Prefer a version that protects credential files from creation and restricts authenticated requests to trusted HTTPS destinations. Supply your key privately through PATENTMAX_API_KEY instead of chat. Review the selected invention materials and PatentMax's confidentiality and retention terms before approving upload and charges.

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
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (25)

Tainted flow: 'req' from os.environ.get (line 166, 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 170)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 246, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Sending the bearer key to the intended PatentMax HTTPS service is legitimate, but the request helper does not require HTTPS or constrain the destination to a trusted origin. An unsafe endpoint override or cross-origin redirect can expose the Authorization header and potentially confidential invention materials; exploitation requires control of configuration or redirect behavior, not merely normal use.

Content

Scanner excerpt · scripts/patentmax_disclosure.py (reported line 255)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:

The workflow submits potentially confidential invention materials to PatentMax without an explicit third-party data-sharing warning.

High
Category
Output Handling
Confidence
94% confidence
Finding

The documented workflow encourages submitting R&D files or project directories to a third-party generation service without explicitly explaining that their contents will leave the local machine or requiring informed approval. Unpublished invention details, proprietary source code, and experimental results are particularly sensitive; unauthorized disclosure could compromise confidentiality and trade-secret protection, although the README alone does not establish the script's actual transmission behavior.

Content

No source excerpt is available for this finding.

Code capability 'env' detected in scripts/patentmax_disclosure.py but not covered by declared permissions.

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'env' capability that is not covered by the declared 'allowed-tools' preapproval. Review the host runtime's actual enforcement policy; runtime permissions are unknown unless separately verified, and this declaration alone does not establish a permission ceiling.

Content

No source excerpt is available for this finding.

Code capability 'network' detected in scripts/patentmax_disclosure.py but not covered by declared permissions.

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'network' capability that is not covered by the declared 'allowed-tools' preapproval. Review the host runtime's actual enforcement policy; runtime permissions are unknown unless separately verified, and this declaration alone does not establish a permission ceiling.

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 · README.md (reported line 59)May include surrounding context.

不需要密钥,装上就能用。 第一次运行时脚本自动领取一份免费试用:¥25 额度、30 天有效,存在本机 ~/.patentmax/。

试用用完后,在 api.ip930.com 注册(再送 ¥50 体验额度)并创建密钥,设成环境变量即可,设了就不再用试用:

bash
export PATENTMAX_API_KEY="pm_live_你的密钥"

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 75)May include surrounding context.

md
# 查状态
curl -s -H "Authorization: Bearer $PATENTMAX_API_KEY" \
  "https://api.ip930.com/api/v1/operations/<operation_id>"

# 取结果
curl -s -H "Authorization: Bearer $PATENTMAX_API_KEY" \

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 79)May include surrounding context.

md
# 取结果
curl -s -H "Authorization: Bearer $PATENTMAX_API_KEY" \
  "https://api.ip930.com/api/v1/reports/<report_id>"

# 下载交底书 / 核对说明
curl -s -H "Authorization: Bearer $PATENTMAX_API_KEY" -o 技术交底书.docx \

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 83)May include surrounding context.

下载交底书 / 核对说明

curl -s -H "Authorization: Bearer $PATENTMAX_API_KEY" -o 技术交底书.docx
"https://api.ip930.com/api/v1/reports/<report_id>/files/report.docx" curl -s -H "Authorization: Bearer $PATENTMAX_API_KEY" -o 核对说明.docx
"https://api.ip930.com/api/v1/reports/<report_id>/files/report.docx?kind=notes"

text

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 85)May include surrounding context.

curl -s -H "Authorization: Bearer $PATENTMAX_API_KEY" -o 技术交底书.docx
"https://api.ip930.com/api/v1/reports/<report_id>/files/report.docx" curl -s -H "Authorization: Bearer $PATENTMAX_API_KEY" -o 核对说明.docx
"https://api.ip930.com/api/v1/reports/<report_id>/files/report.docx?kind=notes"

text

**`Idempotency-Key` 必填。** 同一个键重试不会重复扣费,但同一个键配不同的材料会被拒绝。

The skill mandates Chinese user-facing messages without offering a language choice.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

The workflow requires the agent to send a specific Chinese sentence when generation starts, regardless of the user's language. The verbatim progress instructions at lines 148–161 and fixed closing sentence at lines 193–195 reinforce this requirement, without user opt-in or a documented justification for restricting the output language.

Content

No source excerpt is available for this finding.

Submission instructions lack a privacy warning about sending invention materials to a third-party service.

Medium
Category
Output Handling
Confidence
95% confidence
Finding

The submission examples send invention materials and ideas to PatentMax without warning that potentially confidential R&D information leaves the local environment. This is particularly sensitive in a patent-disclosure workflow: domestic model provenance does not establish confidentiality, retention limits, or permission to disclose proprietary information. The provided file does not establish that users must authorize this transfer before submission.

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 · references/faq.md (reported line 60)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
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 60)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
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 67)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: 任取一个唯一串" \

The workflow submits potentially confidential invention materials without warning users about external processing.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

The workflow directs submission of invention files and supplemental details for server-side processing, but its confirmation step discloses only cost and turnaround time, not the external transfer of sensitive material. Unpublished invention disclosures can contain valuable trade secrets, making uninformed sharing particularly consequential; the claim that only domestic models are used does not establish confidentiality, retention limits, or permission to share.

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 · references/faq.md (reported line 7)May include surrounding context.

md
| 现象 | 处理 |
| --- | --- |
| `免费试用额度已用完` / `免费试用只开通了……` | 免费试用的额度用完了,或者想用别的功能。注册 PatentMax 再送 ¥50 体验额度,创建密钥后 `export PATENTMAX_API_KEY=pm_live_xxx`:https://api.ip930.com/features/api-platform |
| `免费试用密钥已过期或失效` | 本地缓存已自动清掉,重跑同一条命令会领新的;或者换成正式密钥 |
| `HTTP 401` | 密钥无效或已撤销,到控制台重新创建 |
| `HTTP 402` | 余额不足,到控制台充值 |

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/patentmax_disclosure.py (reported line 128)May include surrounding context.

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

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/patentmax_disclosure.py (reported line 207)May include surrounding context.

python
if API_KEY:
        return API_KEY
    if not TRIAL_SOURCE:
        die("还没有设置 PatentMax 密钥。到 https://api.ip930.com/features/api-platform 注册(新用户送 ¥50 体验额度)"
            "并创建密钥,设成环境变量 PATENTMAX_API_KEY=pm_live_xxx 后,再运行同一条命令。", EXIT_INPUT)
    API_KEY = _load_trial_key() or _claim_trial_key()
    KEY_FROM_TRIAL = True

Tainted flow: 'path' from os.environ.get (line 183, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
90% confidence
Finding

The trial API key is written using ordinary file creation before permissions are restricted with chmod. With a common permissive umask, another local user can potentially read the credential during this interval; the cache directory is also created without explicitly private permissions.

Content

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

python
path = _trial_key_path()
    try:
        os.makedirs(os.path.dirname(path), exist_ok=True)
        with open(path, "w", encoding="utf-8") as fh:
            json.dump({
                "api_key": key,
                "expires_at": data.get("expires_at"),

Tainted flow: 'operation' from os.environ.get (line 641, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

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

python
record.update({k: v for k, v in fields.items() if v is not None})
    try:
        os.makedirs(os.path.dirname(_task_path(operation)), exist_ok=True)
        with open(_task_path(operation), "w", encoding="utf-8") as fh:
            json.dump(record, fh, ensure_ascii=False, indent=2)
    except OSError:
        pass

Tainted flow: 'saved' from os.environ.get (line 588, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

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

python
path += "?kind=notes"
        payload = request(path, raw=True)
        saved = unique_path(os.path.join(target, name))
        with open(saved, "wb") as handle:
            handle.write(payload)
        files[kind] = saved
    full = unique_path(os.path.join(target, f"{DOC_NAME}_{stem}_结果.json"))

Tainted flow: 'full' from os.environ.get (line 592, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

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

python
handle.write(payload)
        files[kind] = saved
    full = unique_path(os.path.join(target, f"{DOC_NAME}_{stem}_结果.json"))
    with open(full, "w", encoding="utf-8") as handle:
        json.dump(result, handle, ensure_ascii=False, indent=2)

    figures = result.get("figures") or []

The error-handling instructions require the agent to relay Chinese messages verbatim without offering a language choice.

Low
Category
Output Handling
Confidence
91% confidence
Finding

The docstring explicitly identifies error messages as Chinese user-facing explanations and instructs the AI to repeat them verbatim without rewriting; L017 gives the same instruction. This fixes the language of those responses without user opt-in or a documented justification for a Chinese-only requirement.

Content

No source excerpt is available for this finding.

Progress reporting fabricates percentages despite explicitly promising not to invent them.

Low
Category
Excessive Agency
Confidence
99% confidence
Finding

The docstring at L494 says percentages are shown only when supplied by the server and are not invented when absent. However, L503–L504 call shown_progress(), which substitutes zero for missing server progress (L460–L461) and computes increasing percentages from elapsed time (L478–L488). Users therefore receive estimated percentages presented as progress measurements, directly contradicting the documented reporting policy.

Content

No source excerpt is available for this finding.