Back to skill

Security audit

patent-search

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly behaves like a 9235 patent/IP search client, but its export path can silently install unpinned Python packages and create risky spreadsheet exports.

Review before installing. Use it only where sending patent and IP search terms to 9235 is acceptable, keep the API token scoped and protected, preinstall export dependencies from a trusted pinned environment, and treat generated CSV/XLSX files as untrusted until formula-neutralization is fixed.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
export_deps.py:19
Finding

Unpinned Dependencies Are Automatically Installed During Runtime

Content
View full analysis
bool: if package in _INSTALL_ATTEMPTED: return False _INSTALL_ATTEMPTED.add(package) commands: list[list[str]] = [] uv = shutil.which("uv") if uv: commands.append([uv, "pip", "install", package, "-q"]) commands.append([sys.executable, "-m", "pip", "install", package, "-q"]) for cmd in commands: try: proc = subprocess.run( cmd, timeout=180, capture_output=True, text=True, ) if proc.returncode == 0: importlib.invalidate_caches() return True except (OSError, subprocess.TimeoutExpired): continue return False ``` The installation behavior is invoked by the optional export dependency checks: ```python def ensure_openpyxl() -> Tuple[bool, str | None]: try: import openpyxl return True, None except ImportError: if _try_install("openpyxl"): try: import openpyxl return True, None except ImportError: pass ``` A corresponding path installs `python-docx` through `_try_install("python-docx")`. ### Technical Analysis The Skill invokes `uv pip install` or `python -m pip install` automatically during normal execution if an export dependency is unavailable. The package names are fixed, and no shell interpolation or direct command injection was identified. However, package versions and artifact hashes are not pinned or verified. This creates a supply-chain trust boundary at runtime. The code installed and subsequently imported can vary after the Skill has been audited, depending on: - The current package version published to t ...[truncated 2138 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
excel_export.py:43
Finding

Untrusted Patent Data Is Exported Without Spreadsheet Formula Neutralization

Content
View full analysis
bytes: buf = io.StringIO() writer = csv.writer(buf) writer.writerow(list(headers)) for row in rows: writer.writerow( [strip_markup(c) if isinstance(c, str) else c for c in row] ) return buf.getvalue().encode("utf-8-sig") ``` The XLSX export path has the same issue: ```python ws.append(list(headers)) for row in rows: ws.append([strip_markup(c) if isinstance(c, str) else c for c in row]) ``` The exported rows include externally supplied patent fields in `patent_skill.py:95-108`: ```python rows.append( [ i, p.get("id", ""), xl.strip_markup(p.get("title", "")), xl.strip_markup(p.get("applicant", "")), xl.strip_markup(p.get("inventor", "")), p.get("applicationDate", ""), p.get("documentDate", ""), p.get("ipc", ""), p.get("legalStatus", ""), xl.strip_markup(p.get("summary", ""))[:500], ] ) ``` ### Technical Analysis Patent titles, applicant names, inventor names, summaries, and other fields originate from a remote API. These fields must therefore be treated as untrusted data. The current `strip_markup()` operation removes HTML-like markup, but it does not address spreadsheet formula syntax. A value beginning with `=`, `+`, `-`, or `@`, including a value where such a character follows whitespace or control characters, may be interpreted as a formula when the generated XLSX or CSV file is opened in spreadsheet software. For XLSX output, `openpyxl` can store a string beginning with `=` as a formula cell. For CSV output, interpretation occurs when Exc ...[truncated 1883 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (33)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented command set includes capabilities beyond the declared scope, including additional patent data accessors and non-patent searches. In agent ecosystems, hidden or under-declared capability breadth increases the risk of overbroad authorization, accidental misuse, and inadequate security review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented command set includes capabilities beyond the declared scope, including additional patent data accessors and non-patent searches. In agent ecosystems, hidden or under-declared capability breadth increases the risk of overbroad authorization, accidental misuse, and inadequate security review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented command set includes capabilities beyond the declared scope, including additional patent data accessors and non-patent searches. In agent ecosystems, hidden or under-declared capability breadth increases the risk of overbroad authorization, accidental misuse, and inadequate security review.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill metadata says it is for patent search, but the code also exposes trademark and copyright search methods. This is a scope-expansion issue: users or downstream agents may invoke capabilities that were not declared, weakening review boundaries and enabling unexpected external queries to third-party services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README promotes patent, company, and analytics queries against a third-party API but does not clearly disclose that user-entered search terms, company names, and related metadata will be transmitted off-platform to 9235. This can create a privacy and data-governance risk, especially if users submit sensitive R&D topics, internal company targets, or confidential investigation terms under the assumption that processing is local.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill documents capabilities that require network access, filesystem reads/writes, environment-variable access, and shell execution, but it does not declare any explicit tool scope or permissions boundary. In an agent environment, this weakens least-privilege controls and can allow broader execution than users or reviewers would infer from the manifest.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest does not mention file-download behavior even though the documentation advertises PDF/image downloads and exports. Undisclosed local-write behavior is a security-relevant capability because it can affect disk usage, data handling, and downstream processing expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module docstring is written as a Chinese-only user-facing description, and later user-visible strings are also fixed in Chinese. This indicates a locale-specific behavior without any opt-in or explanation that the skill is intended only for a Chinese-language context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The function creates directories and writes export bytes to a persistent uploads path, which can affect user data and system state. In this file there is no confirmation prompt, logging/print statement, or comment/docstring warning that an export file will be saved on disk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill automatically installs Python packages during execution even though patent search/export functionality does not require self-modifying behavior. This creates a software supply-chain risk: compromise of package indexes, dependency confusion, or a tampered mirror could lead to arbitrary code execution in the agent environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Installing packages without any user-facing warning or confirmation removes an important control over environment changes. In an agent or shared runtime, silent dependency installation can unexpectedly alter the system, introduce malicious packages, or violate organizational policy without the operator realizing it.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

The subprocess call itself is not obviously command-injectable because it uses argument lists and only invokes fixed package-manager commands, but it still launches external installers at runtime. In this skill context, spawning pip/uv to modify the environment expands the attack surface and can pull untrusted code from package indexes, making the behavior security-relevant rather than a harmless implementation detail.

Content

Scanner excerpt · export_deps.py (reported line 32)May include surrounding context.

python
for cmd in commands:
        try:
            proc = subprocess.run(
                cmd,
                timeout=180,
                capture_output=True,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The user-facing docstrings, help text, command descriptions, error messages, and configuration guidance are presented exclusively in Chinese throughout the file. This creates a natural-language locale constraint without any opt-in, fallback language, or documentation that the skill is intentionally limited to Chinese-speaking users or a China-specific deployment context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description limits the skill to patent search and analytics via the 9235 API, specifically mentioning patent search, detail, claims, company portrait, and Excel export. The help text and parser add commands for copyright and trademark search, which are distinct IP domains and materially broader than the declared patent-focused behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s docstrings, prompts, status messages, and usage guidance are consistently written only in Chinese, with no indication that users may opt into another language or that the skill is intentionally limited to a Chinese-speaking context. Under the language/locale policy, forcing a specific language without opt-in can be a policy violation unless clearly documented as region-specific or justified.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · patent_api.py (reported line 460)May include surrounding context.

python
if method.upper() == 'GET':
                response = requests.get(url, params=params, timeout=30)
            else:
                response = requests.post(url, json=params, timeout=30)
            
            if response.status_code == 200:
                return response.json()

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill includes download helpers that fetch remote PDF/image content and write it to local disk, which exceeds a typical search-only API client. Because filenames and output paths are derived from input and there is no containment or confirmation, this expands the agent from read-only retrieval into persistent local file modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The PDF download function performs a network request and writes the response to disk without any approval, warning, or policy check. In an agent setting this can be triggered indirectly, causing unreviewed persistence of remote content and increasing risk from malicious paths, oversized files, or unintended data handling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The image download helper likewise fetches remote content and writes it locally without user confirmation or execution-policy guardrails. This creates the same unsafe persistence channel and broadens the skill from informational lookup into filesystem modification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and all user-facing help/output strings are written only in Chinese, with no indication that the skill is region-specific or that users may choose another language. This creates a natural-language locale policy issue because the skill effectively mandates a specific language without opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill exposes copyright and trademark search commands even though the declared metadata says it is a patent-only skill. This creates a scope mismatch that can bypass user/admin expectations, review boundaries, or policy gating tied to the manifest, causing unreviewed functionality to be reachable.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The help text advertises copyright and trademark features that are outside the stated patent-search scope. Even if partly documentation-related, this increases the chance users invoke unmanifested capabilities and confirms the hidden scope expansion is intentional in the shipped skill behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The function silently retrieves a credential from either an environment variable or the local OpenClaw CLI configuration without any user-facing disclosure or explicit consent at the point of use. In an agent-skill context, undisclosed credential access is sensitive because users may not expect the skill to read locally available secrets, increasing the risk of surprising data access or downstream exfiltration if other code later uses the token unsafely.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · patent_token.py (reported line 18)May include surrounding context.

python
if t:
        return t
    try:
        result = subprocess.run(
            [
                "openclaw",
                "config",

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest does not mention file-download behavior even though the documentation advertises PDF/image downloads and exports. Undisclosed local-write behavior is a security-relevant capability because it can affect disk usage, data handling, and downstream processing expectations.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
excel_export.py:33

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
patent_skill.py:28