Back to skill

Security audit

Kaipai

Security checks for vulnerabilities and agentic risk

Overview

The skill coherently implements paid media processing with disclosed messaging integrations and user authorization.

Install if you accept sending selected media to Kaipai and consuming paid account quota. Optional delivery uses your messaging credentials and sends results to the selected conversation. Protect credentials and saved media links, keep dependencies current, and review server-provided billing or recovery instructions before acting.

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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (79)

Tainted flow: 'token' from os.environ.get (line 63, 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/notifications/telegram.py (reported line 77)May include surrounding context.

python
img_bytes = r.content
            filename = image_source.split("?")[0].split("/")[-1] or "image.jpg"
            files = {"photo": (filename, img_bytes, "image/jpeg")}
            resp = requests.post(
                f"{TELEGRAM_API_BASE}/bot{token}/sendPhoto",
                data=data,
                files=files,

Tainted flow: 'token' from os.environ.get (line 63, 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/notifications/telegram.py (reported line 89)May include surrounding context.

python
return None, {"error": message, "error_details": {"error": message}}
            with open(image_source, "rb") as f:
                files = {"photo": (os.path.basename(image_source), f, "image/jpeg")}
                resp = requests.post(
                    f"{TELEGRAM_API_BASE}/bot{token}/sendPhoto",
                    data=data,
                    files=files,

Tainted flow: 'token' from os.environ.get (line 130, 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/notifications/telegram.py (reported line 159)May include surrounding context.

python
except Exception as exc:
                    print(f"[telegram] Thumbnail download error: {exc}, skipping", file=sys.stderr)

            resp = requests.post(
                f"{TELEGRAM_API_BASE}/bot{token}/sendVideo",
                data=data,
                files=files,

Tainted flow: 'token' from os.environ.get (line 183, 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/notifications/telegram.py (reported line 185)May include surrounding context.

python
"""Send plain text message."""
        token = self._get_token()
        print("[telegram] Sending text message", file=sys.stderr)
        resp = requests.post(
            f"{TELEGRAM_API_BASE}/bot{token}/sendMessage",
            json={"chat_id": chat_id, "text": text},
            timeout=(CONNECT_TIMEOUT, 30),

Tainted flow: 'token' from os.environ.get (line 1013, credential/environment) → requests.get (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/vmake_ai.py (reported line 1022)May include surrounding context.

python
}
            )
            return 1
        r = requests.get(
            f"https://api.telegram.org/bot{token}/getFile",
            params={"file_id": args.telegram_file_id},
            timeout=(CONNECT_TIMEOUT, READ_TIMEOUT),

Tainted flow: 'dl_url' from os.environ.get (line 1043, credential/environment) → requests.get (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/vmake_ai.py (reported line 1044)May include surrounding context.

python
)
        filename = f"tg_{uuid.uuid4().hex[:8]}.{extension}"
        dl_url = f"https://api.telegram.org/file/bot{token}/{file_path}"
        r2 = requests.get(
            dl_url,
            timeout=skill_config.url_download_timeout_tuple(),
            headers={

Tainted flow: 'feishu_token' from os.environ.get (line 1066, credential/environment) → requests.get (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/vmake_ai.py (reported line 1074)May include surrounding context.

python
{"error": '请配置 FEISHU_APP_TOKEN 或提供 --feishu-app-token'}
            )
            return 1
        r = requests.get(
            f"https://open.feishu.cn/open-apis/im/v1/messages/"
            f"{args.feishu_message_id}/resources/{args.feishu_image_key}",
            params={"type": "image"},

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 148)May include surrounding context.

md
`kaipai-<version>-<YYYYMMDD-HHMMSS>.zip`, including its generated Skill card.
Brand conversion does not translate all prompts or documentation.
Use `--outdir /path/to/output` to select another directory, or `--force` to
replace an existing artifact with the same timestamp. Offline tests run before packaging; `--skip-tests`
is available for a previously verified build.

The default ZIP contains `openclaw-kaipai-ai/` with Skill instructions, runtime

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied chunk implements Telegram video delivery rather than Kaipai task discovery or media restoration. Although delivery could support a larger media-processing workflow, uploading local files to an independently specified external chat is a distinct, undeclared capability, not merely an internal implementation detail. The underlying notifier implementation is not supplied, so its precise network behavior cannot be independently verified here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code performs image messaging rather than Kaipai AI processing, catalog discovery, or task execution. Although delivering processed images could support a larger workflow, sending images to an independently specified Feishu recipient is a distinct external communication capability absent from the description. The notifier implementation is not supplied, so its precise credential handling, download behavior, and network operations cannot be independently verified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code implements a Feishu messaging utility rather than Kaipai media processing or task discovery. Outbound delivery to arbitrary specified users or chats is a distinct capability not disclosed in the declared purpose, rather than merely an internal implementation detail of watermark removal. The actual upload and messaging implementation is delegated to FeishuNotifier and is not included in the chunk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Credential-setup guidance could support the declared service, but the code additionally accesses a separate messaging platform's credentials and exercises its messaging capability, neither of which is disclosed. The supplied chunk performs no remote task discovery or media processing. The mismatch is the undeclared Feishu credential access and outbound messaging, not merely the absence of processing in this chunk. The Feishu secrets are sent to Feishu's authentication endpoint; the code does not show them being sent to an unrelated destination.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The supplied code implements Telegram image delivery rather than Kaipai processing, catalog discovery, or task execution. Although delivery could support a larger processing workflow, this independently callable external-sharing capability is not described and is more than an internal implementation detail. The notifier implementation is not supplied, so the precise download and upload behavior cannot be independently verified from this chunk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied command targets image delivery to a recipient rather than Kaipai AI processing. Delivering a processed result could support the declared workflow, but sending it through Feishu introduces an undeclared external communication destination. The script implementation is not supplied, so actual transmission cannot be verified from this chunk alone.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared purpose covers media processing, not sending media notifications to a specified recipient. The supplied command invokes notify rather than a catalog-discovery or processing task. Although notification could support a broader processing workflow, this standalone recipient-directed operation exposes an undeclared communication capability. The underlying script is not shown, so actual transmission cannot be confirmed from this chunk alone.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Delivering a processed video may be related to the workflow, but sending it to an external messaging recipient is a distinct capability beyond the declared media-processing operations. The supplied chunk invokes that delivery helper; its internal implementation is not shown.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The chunk implements external media delivery rather than Kaipai processing. Although notifications can support a media-processing workflow, transmitting media and messages to Telegram introduces a distinct data-sharing capability and credential requirement not represented in the description. The destination is caller-specified, and there is no evidence of a hard-coded malicious recipient. The absence of catalog discovery or processing calls in this helper module alone is not treated as a mismatch.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The upload, authentication, polling, and caching behavior supports the declared service and is not itself a mismatch. However, txt2img() explicitly submits the hard-coded task 'txt2img', while img2img() similarly submits 'img2img'; neither first discovers or validates those names against a remote task catalog. invoke() and run() also accept unrestricted task names. Retrieving token policies supplies execution configuration, not catalog validation. These are concrete capabilities beyond, or contrary to, the declared scope and discovery requirement. The supplied chunk does not establish whether a higher-level facade implements the promised OpenClaw video workflow, so its absence here is not treated as an additional mismatch.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Result delivery can support media processing, but this module adds a distinct external messaging integration and credential access not disclosed in the declared purpose or permissions. These are substantive capabilities beyond implementation details of Kaipai processing. The behavior occurs when the notifier is invoked; the snippet does not show automatic transmission or malicious credential exfiltration. The absence of catalog discovery or task execution in this helper alone is not evidence of a workflow violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The supplied command performs image delivery through Feishu rather than Kaipai processing or task discovery. Although it could deliver a processed result, transmitting images to a specified external recipient is a distinct capability, not merely an internal implementation detail. The script implementation is not supplied, so this assessment is limited to the exposed invocation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The supplied command uses TELEGRAM_BOT_TOKEN to initiate Telegram image delivery, rather than performing the declared Kaipai processing workflow. Although delivering results could support that workflow, sending media through a separate authenticated messaging service introduces an undeclared external communication capability. The script implementation is not supplied, so no additional behavior is inferred.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

Downloading a processed video is a reasonable supporting implementation detail. However, invoking feishu_send_video.py with a recipient identifier introduces outbound messaging beyond the declared media-processing purpose. The supplied chunk does not show the helper's implementation or establish malicious intent, but it explicitly requests video delivery to a recipient. The absence of task discovery or processing in this partial chunk is not itself treated as a mismatch.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 243)May include surrounding context.

md
1. Request matching Access Key and Secret Key from your administrator.

2. Set MT_AK and MT_SK in scripts/.env (see scripts/.env.example), then run:
   source scripts/.env

If keys are issued by your organization, ask your administrator.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 244)May include surrounding context.

  1. Request matching Access Key and Secret Key from your administrator.

  2. Set MT_AK and MT_SK in scripts/.env (see scripts/.env.example), then run: source scripts/.env

If keys are issued by your organization, ask your administrator.

text

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 497)May include surrounding context.

md
m runs, and config fetch go through `kaipai_ai.py`; agents do not need to open `client.py` / `ai/api.py`. **Must not** bypass this with direct HTTP to AIGC/WAPI