Back to skill

Security audit

企业专利分析 · PatentMax

Security checks for vulnerabilities and agentic risk

Overview

This patent-report skill needs review because background-document sharing is insufficiently disclosed and saved API keys lack adequate protection.

Before use, confirm exactly which background documents may be sent to PatentMax and omit confidential material unless sharing is authorized. Keep production keys out of chat and use protected credential storage. The client should restrict authenticated requests to approved HTTPS destinations and reject cross-origin redirects before you rely on it with a paid key.

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_competitive.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

Sending the PatentMax key to its intended API is necessary, but this helper attaches the bearer token without enforcing an approved HTTPS destination. An overridden BASE_URL can receive the saved production key, and urllib's default redirect handling can forward the Authorization header to another origin if the API redirects there.

Content

Scanner excerpt · scripts/patentmax_competitive.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
98% confidence
Finding

The supplied command exposes part of an API key rather than analyzing patents or producing competitive intelligence. Although using a patent-service API key could support the declared purpose, printing credential material is an undeclared disclosure behavior, not a necessary implementation detail. The chunk does not demonstrate network transmission or disclosure of the complete key.

Content

No source excerpt is available for this finding.

Code capability 'env' detected in scripts/patentmax_competitive.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_competitive.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 55)May include surrounding context.

不需要密钥,装上就能用。 第一次运行时脚本自动领取一份免费试用:¥15 额度、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 129)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: 自定义唯一串" \

The report-creation workflow lacks a warning that analysis inputs are sent to the external PatentMax service.

Medium
Category
Output Handling
Confidence
93% confidence
Finding

The documented workflow creates an externally generated report without explicitly warning that the supplied company, technical subject, and any optional background materials will leave the local environment. In competitive intelligence and patent due diligence, these inputs can reveal confidential R&D priorities or transaction interests; mentioning PatentMax as the data source does not clearly disclose this outbound processing. This is a documentation-level privacy gap; the README alone does not establish whether the script provides additional safeguards.

Content

No source excerpt is available for this finding.

Background materials are included in a PatentMax task without an explicit third-party data-sharing warning.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The skill instructs the agent to include user-provided background materials in a PatentMax task without explicitly confirming permission to transmit those materials to the external service. Although PatentMax's involvement and the paid task are disclosed, the confirmation does not identify the materials being shared; patent due diligence and competitive analysis can involve confidential product plans or unpublished inventions.

Content

No source excerpt is available for this finding.

The background-file instructions omit a privacy warning about transmitting its contents to PatentMax.

Medium
Category
Output Handling
Confidence
88% confidence
Finding

The FAQ recommends supplying background materials through --materials-file without explaining that their contents will be submitted to the external PatentMax service. In a competitive-intelligence or patent-due-diligence workflow, these materials could include confidential strategy or unpublished technical information, making uninformed disclosure consequential; the provided file does not demonstrate arbitrary file collection or malicious exfiltration.

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

The workflow instructs attaching user-provided company materials without warning that they will be submitted to an external service.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The workflow directs the agent to attach user-provided company materials to a server-backed analysis task without explaining that those materials will leave the user's environment. In competitive intelligence and patent due diligence, attachments may contain confidential product plans, unpublished inventions, or proprietary research; confirmation of the task's price does not establish informed consent to disclose these materials. The script implementation is not provided, so the exact transfer behavior and destination cannot be verified from this file alone.

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

python
# 密钥版(TRIAL_SOURCE 为空):必须设 PATENTMAX_API_KEY,不领试用。
TRIAL_SOURCE = "company-patent-analysis"
TRIAL_GROUP = "competitive"
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_competitive.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_competitive.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 599, 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_competitive.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

Tainted flow: 'path' from os.environ.get (line 573, 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_competitive.py (reported line 574)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 579, 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_competitive.py (reported line 580)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

The delivery instructions require a fixed Chinese closing sentence without language opt-in.

Low
Category
Output Handling
Confidence
98% confidence
Finding

The skill mandates that the final sentence be a specific Chinese sentence, rather than merely providing an illustrative response. This imposes Chinese output even for users interacting in another language, with no language choice or documented locale-specific justification.

Content

No source excerpt is available for this finding.

Requires the agent to relay Chinese error messages verbatim without a user language choice.

Low
Category
Output Handling
Confidence
95% confidence
Finding

The docstring explicitly instructs the AI to repeat the user-facing Chinese error message unchanged and not rephrase it. This imposes Chinese on that part of the response without user opt-in or a documented locale-specific justification.

Content

No source excerpt is available for this finding.