Back to skill

Security audit

testskill-0410zip1

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Knot agent editor, but it needs Review because it disables TLS certificate checks while sending credentials and can make persistent agent changes.

Install only if you trust the Knot service and the internal network path. Treat the environment token and username as sensitive, avoid using this until TLS certificate verification is fixed or a trusted CA bundle is configured, inspect any @file arguments before running modify_draft.py, and be especially careful before regenerating or publishing drafts because those actions can overwrite or expose production Agent behavior.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/common.py:10
Finding

Authentication Credentials Transmitted Without TLS Certificate Verification

Content
View full analysis
dict: """通用 POST 请求,返回响应 JSON""" resp = requests.post(url, headers=headers, json=payload, verify=False, timeout=15) resp.raise_for_status() data = resp.json() if data.get("code") != 0: print(f"错误:API 请求失败({url}):{data.get('msg')}", file=sys.stderr) sys.exit(1) return data ``` ### Technical Analysis The initial API request transmits the `KNOT_JWT_TOKEN` in the JSON body and `KNOT_USERNAME` in an HTTP header. Subsequent requests transmit the generated Knot API token through the `x-knot-api-token` header. Although HTTPS is used, `verify=False` disables validation of the server certificate. The client will therefore accept certificates that are expired, self-signed, issued for another hostname, or supplied by an untrusted certificate authority. Suppressing `InsecureRequestWarning` also conceals the unsafe connection from the operator. The behavior is documented in `references/api.md`, but documenting an insecure requirement does not mitigate the vulnerability. Credential transmission is necessary for the declared functionality; transmission without authenticating the remote server exceeds the minimum safe privilege and trust requirements. ### Attack Path 1. An attacker obtains a network interception position, such as control of a prox ...[truncated 1332 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/modify_draft.py:41
Finding

Unrestricted Local File Reading and Upload Through Draft Fields

Content
View full analysis
str: """若 value 以 @ 开头,则从文件读取内容""" if value and value.startswith("@"): file_path = value[1:] if not os.path.exists(file_path): print(f"错误:文件不存在:{file_path}", file=sys.stderr) sys.exit(1) with open(file_path, "r", encoding="utf-8") as f: return f.read() return value ``` ```python payload = {} if args.name is not None: payload["name"] = resolve_value(args.name) if args.desc is not None: payload["desc"] = resolve_value(args.desc) if args.welcome_msg is not None: payload["welcome_msg"] = resolve_value(args.welcome_msg) if args.system_prompt is not None: payload["system_prompt"] = resolve_value(args.system_prompt) if args.model is not None: payload["default_llm_model"] = args.model ``` ```python result = api_post( f"{BASE_URL}/openapi/v1/agents/modify_draft", headers, payload, ) ``` ### Technical Analysis Any argument beginning with `@` is interpreted as a local file path. The script opens the path with the current process’s filesystem privileges, reads its complete contents, inserts those contents into an Agent draft payload, and sends the payload to the Knot API. There is no approved-directory restriction, regular-file validation, symbolic-link protection, maximum file-size limit, sensitive-path rejection, or explicit disclosure confirmation. Absolute paths and parent-directory traversal paths are accepted if the process can read them. The documented use case describes file loading for `--system_prompt`, but the implementation also applies `resolve_value` to `--name`, `--desc`, and `--welcome_msg`. This expands local-file access beyond t ...[truncated 1661 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/publish_draft.py:18
Finding

Draft Publication Proceeds When Stale-State Verification Fails

Content
View full analysis
bool: """检查草稿是否过期,返回 is_stale 状态""" try: result = api_post( f"{BASE_URL}/openapi/v1/agents/get_draft", headers, {"agent_id": agent_id}, ) draft = result.get("data") or {} return bool(draft.get("is_stale")) except SystemExit: return False ``` ```python # 检查草稿是否过期 is_stale = check_draft_stale(agent_id, headers) print("\n" + "=" * 60) print("⚠️ 高危操作确认") print("=" * 60) print(f"Agent ID : {agent_id}") print("操作说明 : 将当前草稿发布为正式版本") print("影响范围 : 发布后,所有用户的正式对话立即使用新版本") if is_stale: print("\n🔴 警告:当前草稿已过期!") print(" 草稿基于的版本低于 Agent 最新发布版本。") print(" 发布此草稿将覆盖 Agent 最新版本的改动,可能导致数据丢失!") print(" 建议先运行 new_draft.py 基于最新版本重新生成草稿。") print("\n请输入 yes 确认发布,其他任意键取消:", end="") confirm = input().strip().lower() if confirm != "yes": print("已取消发布操作。") sys.exit(0) result = api_post( f"{BASE_URL}/openapi/v1/agents/publish_draft", headers, {"agent_id": agent_id}, ) ``` ### Technical Analysis `api_post` terminates with `SystemExit` when the API returns a nonzero application status. `check_draft_stale` catches that exception and returns `False`. As a result, two materially different states are represented by the same Boolean value: - The server successfully verified that the draft is not stale. - The stale-state lookup failed and the state is unknown. The publication workflow interprets both states as safe enough to continue. It suppresses the stale warning and permits publication after the ordinary confirmation. This is a fail-open design for a production-impacting operation. The script still requires the user to enter `yes`, so pu ...[truncated 1394 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (20)

Tainted flow: 'username' from os.environ.get (line 19, credential/environment) → requests.post (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/common.py (reported line 31)May include surrounding context.

python
def get_api_token(jwt_token: str, username: str) -> str:
    """通过 JWT token 获取 Knot API Token"""
    resp = requests.post(
        f"{BASE_URL}/api/v1/mcpport/get_config",
        headers={"X-Username": username, "Content-Type": "application/json"},
        json={"jwt_token": jwt_token, "for_knot_api_token": True},

Tainted flow: 'payload' from os.environ.get (line 65, credential/environment) → requests.post (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/common.py (reported line 78)May include surrounding context.

python
def api_post(url: str, headers: dict, payload: dict) -> dict:
    """通用 POST 请求,返回响应 JSON"""
    resp = requests.post(url, headers=headers, json=payload, verify=False, timeout=15)
    resp.raise_for_status()
    data = resp.json()
    if data.get("code") != 0:

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Beyond disabling SSL verification, the documentation provides no warning about the resulting loss of transport authenticity and integrity. This is especially dangerous here because the skill manages sensitive administrative actions on agents; without verified TLS, attackers could intercept tokens, observe configuration contents such as system prompts, or alter responses and requests to induce unauthorized edits or publication.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill exposes powerful capabilities via terminal-invoked Python scripts that can read environment-derived authentication context, access local files, and make network/API calls, but it declares no explicit tool scope or permission boundary. In a skill that can modify and publish agent configurations, this lack of scoping increases the risk of unintended tool use, overbroad access, and misuse of sensitive credentials or APIs if the skill is invoked in unexpected contexts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest-style description is entirely written in Chinese and presents the skill's invocation and behavior in that language, without indicating that users may choose another language or locale. Under the policy for natural-language violations, forcing a specific language without opt-in should be flagged unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation explicitly instructs clients to disable TLS certificate verification for all requests, which defeats HTTPS server authentication and enables man-in-the-middle interception or modification of API traffic. In this skill, the affected traffic includes JWT-derived token exchange, API tokens, and privileged agent-management operations, so an attacker on the network path could steal credentials or tamper with draft/publish requests.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
99% confidence
Finding

verify=False is an unsafe default because developers often copy documentation directly into code, causing insecure transport behavior to propagate into production integrations. In the context of an editor skill that can read and modify agent drafts and publish changes, this default magnifies risk by exposing both secrets and high-impact administrative actions to interception and tampering.

Content

Scanner excerpt · references/api.md (reported line 5)May include surrounding context.

md
BASE_URL: `https://knot.woa.com/apigw`

所有请求需忽略 SSL 校验(`verify=False`),除 `get_config` 外均需 header:`x-knot-api-token: <token>`

---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code reads sensitive environment variables KNOT_JWT_TOKEN and KNOT_USERNAME, which are authentication-related values. Although the function has an internal docstring, there is no user-facing warning, confirmation, or broader disclosure that the skill accesses credentials from the environment.

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 · scripts/common.py (reported line 31)May include surrounding context.

python
def get_api_token(jwt_token: str, username: str) -> str:
    """通过 JWT token 获取 Knot API Token"""
    resp = requests.post(
        f"{BASE_URL}/api/v1/mcpport/get_config",
        headers={"X-Username": username, "Content-Type": "application/json"},
        json={"jwt_token": jwt_token, "for_knot_api_token": True},

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This request sends the username in a header and the JWT token in the JSON body to a remote API endpoint. The code includes no user-facing notice, confirmation, or explicit warning that authentication data is transmitted over the network.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
99% confidence
Finding

The request explicitly sets verify=False, disabling TLS certificate validation while transmitting a JWT token and username to obtain an API token. This allows a man-in-the-middle attacker to intercept or tamper with authentication traffic, potentially leading to account compromise and unauthorized agent management actions.

Content

Scanner excerpt · scripts/common.py (reported line 35)May include surrounding context.

python
f"{BASE_URL}/api/v1/mcpport/get_config",
        headers={"X-Username": username, "Content-Type": "application/json"},
        json={"jwt_token": jwt_token, "for_knot_api_token": True},
        verify=False,
        timeout=15,
    )
    resp.raise_for_status()

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 · scripts/common.py (reported line 78)May include surrounding context.

python
def api_post(url: str, headers: dict, payload: dict) -> dict:
    """通用 POST 请求,返回响应 JSON"""
    resp = requests.post(url, headers=headers, json=payload, verify=False, timeout=15)
    resp.raise_for_status()
    data = resp.json()
    if data.get("code") != 0:

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
99% confidence
Finding

This helper disables TLS verification for all POST requests, making every downstream API call susceptible to interception and response tampering. Because the helper likely carries authenticated headers and agent configuration data, exploitation could expose tokens, leak drafts, or permit malicious modification or publication of agent settings.

Content

Scanner excerpt · scripts/common.py (reported line 78)May include surrounding context.

python
def api_post(url: str, headers: dict, payload: dict) -> dict:
    """通用 POST 请求,返回响应 JSON"""
    resp = requests.post(url, headers=headers, json=payload, verify=False, timeout=15)
    resp.raise_for_status()
    data = resp.json()
    if data.get("code") != 0:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code retrieves a JWT token and username from the environment, derives the current agent context from the token, and performs authenticated POST requests to remote endpoints. Within this file there is no confirmation prompt, warning message, or user-facing disclosure that sensitive authentication context will be used to query backend agent data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains natural-language docstrings and runtime prompts exclusively in Chinese, including usage and safety instructions. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The module description is written only in Chinese, and all user-visible error messages in this file are also hard-coded in Chinese. This indicates a fixed language choice without offering the user any language or locale selection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The only natural-language user-facing documentation in the file is provided in Chinese, which imposes a specific language without offering the user a choice. Under the language/locale policy, hard-coding a language can be a policy violation unless the locale restriction is explicitly justified or optional.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The only natural-language instructions and usage text in this file are in Chinese, with no indication that other languages are supported or that the language choice is intentional and documented. This can violate the language/locale policy when a skill effectively forces one language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script reads authentication-related environment data via get_env() and sends a request to a remote API using those credentials, but the file contains no confirmation prompt, user-facing log, or comment/docstring warning that credentials and query parameters will be transmitted over the network. For a code file, this is a safety-relevant external action that lacks explicit disclosure in the visible file content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring, argument descriptions, and usage examples are entirely in Chinese, which imposes a specific language on users without any opt-in or alternative locale. Under the policy, language-only instructions can be a natural-language policy violation unless the locale restriction is explicitly justified or optional.

Content

No source excerpt is available for this finding.