Back to skill

Security audit

Patent Drafting · PatentMax

Security checks for vulnerabilities and agentic risk

Overview

The patent-writing workflow fits its purpose, but weak handling of service keys could expose your account credentials.

Ask the publisher to restrict authenticated requests and redirects to the approved HTTPS service before using a paid key. Configure keys outside chat. Before uploading confidential inventions, review [PatentMax's privacy policy](https://www.ip930.com/legal/privacy) for retention and third-party processing, and confirm the 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 (26)

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

The request helper attaches the API bearer token without validating the destination scheme or origin, and the standard urllib redirect handler can forward that header to a different origin. A configured HTTP endpoint or a hostile redirect can therefore expose credentials and potentially confidential invention materials; normal HTTPS transmission to the intended service is not itself exfiltration.

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:

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

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

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

bash
export PATENTMAX_API_KEY="pm_live_你的密钥"

The submission workflow lacks a privacy warning that unpublished invention materials are sent to a third-party service.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

The README encourages submitting invention disclosures and experimental records through an API-backed workflow, including commands using --yes, without clearly explaining that their contents leave the local machine. These materials can contain unpublished inventions and trade secrets, making uninformed third-party disclosure particularly consequential; the README does not establish what consent checks or data-handling protections the implementation provides.

Content

No source excerpt is available for this finding.

The submission instructions lack a privacy warning that invention materials are sent to an external service.

Medium
Category
Output Handling
Confidence
95% confidence
Finding

The submission examples send invention disclosures and ideas to an external PatentMax service without warning that potentially confidential, unpublished intellectual property leaves the user's environment. Patent drafting makes this omission particularly consequential: unauthorized disclosure or unsuitable retention practices could compromise trade secrets and confidentiality obligations, although the file does not establish the provider's actual practices.

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: 任取一个唯一串" \

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 submission workflow lacks a privacy warning that invention materials and supplemental details are sent to a remote service.

Medium
Category
Output Handling
Confidence
95% confidence
Finding

The workflow asks for consent to a paid task but does not disclose that the supplied files and supplemental technical details will be transmitted to a remote service. In a patent-drafting context, these inputs can contain unpublished inventions and trade secrets, so users may authorize payment without knowingly authorizing sensitive-data disclosure. The claim that all models are domestic does not establish confidentiality, retention limits, or restrictions on downstream use.

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-drafting"
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
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 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

The documented 30-second command limit is not enforced.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The polling deadline does not constrain individual network calls, which may each block for 60 seconds, and completion triggers additional downloads outside that deadline. A slow or stalled service can therefore exceed the advertised command limit and tie up the agent's foreground execution, although the code does not establish a broader system compromise.

Content

No source excerpt is available for this finding.

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 skill mandates a fixed Chinese closing sentence without offering a language choice.

Low
Category
Output Handling
Confidence
97% confidence
Finding

The instruction requires the final sentence to be the exact Chinese text shown, regardless of the user's language. No language opt-in or justified Chinese-only locale constraint is provided; the verbatim progress and error-message requirements also reinforce this restriction.

Content

No source excerpt is available for this finding.

L103 instructs the AI to relay Chinese error messages verbatim, without offering a language choice.

Low
Category
Output Handling
Confidence
94% confidence
Finding

The docstring explicitly identifies error messages as Chinese user-facing explanations and directs the AI to repeat them unchanged. This imposes Chinese on that portion of the response without user opt-in or a documented regional requirement; L17 reinforces the same instruction.

Content

No source excerpt is available for this finding.