Back to skill

Security audit

Patent Competitor Analysis · PatentMax

Security checks for vulnerabilities and agentic risk

Overview

This patent-report skill needs review because document uploads and lasting API-key storage lack clear safeguards, and redirects can expose the key.

Use public or redacted materials unless you explicitly approve sending them to PatentMax. Keep paid keys out of chat and use a restricted key through the documented environment variable. Ask the publisher to secure persistent key storage and block authenticated cross-origin or insecure redirects. Confirm charges and set an overall waiting limit.

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

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
92% confidence
Finding

Sending the PatentMax API key to its intended API is legitimate, but this request helper does not restrict destinations to an approved HTTPS origin. Python's default urllib redirect handling can forward the explicitly added Authorization header across origins, allowing a malicious or compromised endpoint to redirect requests and capture the key; an insecure configured base URL also exposes credentials.

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
99% confidence
Finding

Using an API credential could support patent analysis, but printing part of that credential does not perform or directly support the declared analysis. The supplied command exposes secret material in its output. No external transmission is shown.

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_你的密钥"

The report-creation workflow lacks a privacy warning that the supplied company and technical research direction are sent to the external PatentMax service.

Medium
Category
Output Handling
Confidence
88% confidence
Finding

The documented workflow submits the target company and technical research direction to an external report-generation service without explicitly explaining that disclosure or its privacy implications. Although PatentMax is identified as the provider, the combination of company and research topic can reveal confidential competitive-intelligence interests; optional background materials could be more sensitive. This is a transparency and consent gap, not evidence of malicious exfiltration, and the README alone does not establish the script's actual transmission behavior.

Content

No source excerpt is available for this finding.

The workflow forwards user-provided background materials without warning that they will be submitted to an external service.

Medium
Category
Output Handling
Confidence
93% confidence
Finding

The workflow instructs the agent to include user-provided background materials in an externally processed task without explicitly explaining that those materials leave the user's environment. In patent due diligence and competitive intelligence, these materials may contain confidential technical or business information, and the prescribed confirmation covers price and scope rather than informed consent to disclose those materials.

Content

No source excerpt is available for this finding.

The background-material upload instructions omit a third-party data disclosure warning.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The FAQ encourages supplying background material through --materials-file without explaining that its contents would be submitted to the external report service. In a patent due-diligence workflow, background materials may contain unpublished inventions, confidential strategy, or privileged analysis, making uninformed disclosure a meaningful risk; the script's actual handling is not available for verification.

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

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 workflow submits user-provided corporate materials to a remote task service without a privacy warning.

Medium
Category
Output Handling
Confidence
89% confidence
Finding

The workflow encourages attaching user-provided corporate materials to a server-side analysis task without explaining external disclosure, retention, or confidentiality implications. In patent competitive intelligence, these materials could include nonpublic product plans or technical information; consent to task pricing does not establish informed consent to disclose that information. The materials are optional and may be public, which limits the risk, and the provided workflow alone does not establish the script's actual transmission behavior.

Content

No source excerpt is available for this finding.

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

Medium
Category
Output Handling
Confidence
95% confidence
Finding

The docstring identifies error messages as Chinese user-facing explanations and directs the AI to repeat them unchanged without rephrasing. This imposes Chinese output without user opt-in or a documented justification for restricting the response language.

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 = "patent-competitor-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 documented 30-second command limit is contradicted by a supported wait path that defaults to 5,400 seconds and requests that can block for 60 seconds.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The advertised 30-second command bound is not enforced: individual network requests allow 60 seconds, and the supported legacy wait path defaults to 5,400 seconds. Slow responses or use of that path can occupy a synchronous agent worker far longer than promised, delaying user feedback and potentially triggering host termination; this is principally an availability and reliability issue.

Content

No source excerpt is available for this finding.

The skill requires a fixed Chinese closing sentence without a user language choice.

Low
Category
Output Handling
Confidence
99% confidence
Finding

The instruction makes the quoted Chinese sentence mandatory as the final sentence, regardless of the user's language. No language opt-in or justified locale restriction is provided.

Content

No source excerpt is available for this finding.