Back to skill

Security audit

专利查新检索 · PatentMax

Security checks for vulnerabilities and agentic risk

Overview

The patent-search workflow is coherent, but weaknesses in sending and storing access keys warrant review before use.

Review endpoint validation, redirect handling, and paid-key storage before using confidential material or a paid account. Supply a restricted key outside chat, avoid shared plaintext storage, confirm PatentMax's confidentiality terms, and approve the quoted charge before submission.

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

Tainted flow: 'req' from os.environ.get (line 155, 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_novelty.py (reported line 159)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 235, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
94% confidence
Finding

Bearer authentication is expected for this API client, but _open attaches the API key without enforcing HTTPS or validating the destination origin. PATENTMAX_BASE_URL can select an arbitrary or plaintext endpoint, and urllib's default redirect handling can forward Authorization to another origin; this could expose a paid API credential and confidential, unpublished invention details.

Content

Scanner excerpt · scripts/patentmax_novelty.py (reported line 242)May include surrounding context.

python
req.add_header("Content-Type", "application/json")
    for key, value in (headers or {}).items():
        req.add_header(key, value)
    return urllib.request.urlopen(req, timeout=TIMEOUT)


def request(path, method="GET", body=None, headers=None, raw=False):

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied command exposes part of an API key rather than performing a patent search or patentability assessment. Using an API credential could support the declared purpose, but printing its contents is not a necessary authentication step and introduces an undeclared credential-disclosure behavior. No network transmission is shown.

Content

No source excerpt is available for this finding.

The workflow submits the user's technical solution for processing without warning about disclosure of potentially confidential invention details.

High
Category
Output Handling
Confidence
90% confidence
Finding

The workflow directs the agent to submit a detailed technical solution for processing, but its confirmation step addresses payment rather than informed consent to disclose potentially confidential invention details. Pre-filing patent analysis is particularly sensitive: unauthorized disclosure or inappropriate retention could expose trade secrets and, if the information becomes public, jeopardize patent rights. The provided file does not establish the processing destination or its confidentiality protections, so actual leakage is not demonstrated.

Content

No source excerpt is available for this finding.

Code capability 'env' detected in scripts/patentmax_novelty.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_novelty.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 75)May include surrounding context.

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

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

bash
export PATENTMAX_API_KEY="pm_live_你的密钥"

The usage workflow encourages submitting unpublished invention documents to PatentMax without a confidentiality warning.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

The workflow explicitly encourages using invention disclosures, application drafts, and R&D reports as input to a third-party service without a confidentiality warning or documented data-handling safeguards. These documents can contain unpublished, commercially valuable technical details, so unauthorized retention, access, or onward disclosure could compromise trade secrets and potentially affect patent strategy. External processing is part of the advertised functionality, not evidence of malicious exfiltration, but the sensitivity of patent-search inputs makes this omission significant.

Content

No source excerpt is available for this finding.

The skill requires verbatim Chinese error messages without offering a language choice.

Medium
Category
Output Handling
Confidence
98% confidence
Finding

L257 explicitly identifies the error message as Chinese, and L259 requires forwarding it unchanged. This forces Chinese user-facing output even when the user communicates in another language, without an opt-in or a documented reason for the language restriction.

Content

No source excerpt is available for this finding.

The materials-file workflow lacks a privacy warning about submitting potentially confidential invention details to an external service.

Medium
Category
Output Handling
Confidence
92% confidence
Finding

The materials-file workflow invites submission of potentially unpublished invention details without a point-of-use warning that their contents will be sent to an external service. Such material is especially sensitive in a patent workflow, and users may disclose confidential technical information without understanding the recipient or its retention and access policies; the provided documentation does not establish that disclosure is public or that patent rights would necessarily be lost.

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

实在没有就直接发 HTTP 请求:

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

实在没有就直接发 HTTP 请求:

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: 自定义唯一串" \

Error-handling instructions require verbatim Chinese messages without user language opt-in.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

The docstring instructs the AI to relay the Chinese user-facing error message verbatim and not rewrite it; L014 gives the same instruction. This fixes the language of those responses without offering a language choice or documenting a regional requirement that justifies it.

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

md
Windows PowerShell 用 `$env:PATENTMAX_API_KEY="..."`,CMD 用 `set PATENTMAX_API_KEY=...`。`export` 只对当前终端有效,换窗口要重设。

密钥在 https://api.ip930.com/features/api-platform 自助创建。

## 400 参数不正确

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_novelty.py (reported line 117)May include surrounding context.

python
# 密钥版(TRIAL_SOURCE 为空):必须设 PATENTMAX_API_KEY,不领试用。
TRIAL_SOURCE = "patent-novelty-cn"
TRIAL_GROUP = "novelty"
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_novelty.py (reported line 196)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 172, 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_novelty.py (reported line 175)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 644, 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_novelty.py (reported line 361)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

The documented 30-second command limit is not enforced.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The polling deadline is checked only after a synchronous request whose timeout is 60 seconds, so the advertised 30-second command limit is not enforced. Slow responses, oversized downloads, configurable wait intervals, and the legacy --wait option can keep the foreground process blocked considerably longer, degrading agent availability and potentially causing host termination.

Content

No source excerpt is available for this finding.

Tainted flow: 'path' from os.environ.get (line 618, 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_novelty.py (reported line 619)May include surrounding context.

python
docx = try_download(f"/api/v1/reports/{urllib.parse.quote(report_id)}/files/report.docx")
    if docx:
        path = os.path.abspath(os.path.join(target, f"{REPORT_NAME}_{stem}.docx"))
        with open(path, "wb") as handle:
            handle.write(docx)
        files[REPORT_NAME] = path
    else:

Tainted flow: 'full' from os.environ.get (line 624, 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_novelty.py (reported line 625)May include surrounding context.

python
else:
        out["docx_note"] = "这次没有生成 Word 报告,结论以下面的摘要和完整结果为准。"
    full = os.path.abspath(os.path.join(target, f"{REPORT_NAME}_{stem}_结果.json"))
    with open(full, "w", encoding="utf-8") as handle:
        json.dump(payload, handle, ensure_ascii=False, indent=2)
    files["完整结果"] = full
    out["files"] = files