Back to skill

Security audit

Daily Antifraud Report

Security checks for vulnerabilities and agentic risk

Overview

The skill’s reporting purpose is coherent, but it combines scheduled execution, automatic Feishu posting, and an unsafe helper script without enough scoping or user control.

Review this skill before installing. It is not evidence of malware, but users should only enable it where automatic Feishu distribution is intended, the destination is known, and the helper script is fixed to validate and quote its result-count argument.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/search_cn.sh:4
Finding
Unvalidated Result-Count Argument Enables Arbitrary Local File Reads<![CDATA[ ## Vulnerability Details **File Location**: `scripts/search_cn.sh`, lines 4-10 **Vulnerability Type**: Shell argument injection caused by unquoted expansion and missing input validation **Risk Level**: Medium ### Vulnerable Code ```bash QUERY="$1" NUM="${2:-10}" BAIDU_API="https://www.baidu.com/s?wd=${QUERY}&rn=${NUM}" curl -s "${BAIDU_API}" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" | grep -oP '<h3 class="news-title.*?">.*?<a href="(.*?)".*?>(.*?)</a>.*?</h3>' | head -${NUM} ``` ### Technical Analysis The second positional argument is assigned directly to `NUM` without verifying that it is a positive integer: ```bash NUM="${2:-10}" ``` It is subsequently expanded without quotation marks when passed to `head`: ```bash head -${NUM} ``` Bash performs word splitting on this unquoted expansion. A single attacker-controlled argument containing spaces can consequently become multiple arguments to `head`. In addition to supplying the intended line-count option, an attacker can inject a local file path as an input operand. For example, if the second script argument is supplied as the single string `1 /etc/passwd`, the resulting command is functionally equivalent to: ```bash head -1 /etc/passwd ``` The preceding `curl` or `grep` operation does not prevent exploitation. Even if the malformed result-count value causes the network request to fail, `head` can still open the injected file operand directly. This is argument injection rather than shell command substitution: shell metacharacters embedded in `NUM` are not reparsed as shell syntax. Nevertheless, the ability to inject operands into `head` creates a confirmed local-file disclosure primitive. ### Attack Path 1. An attacker obtains the ability to influence the second argument passed to `scripts/search_cn.sh`, directly or through an Agent-generated invocation. 2. The attacker supplies a value containing a valid `head` count followed by a local file path, suc ...[truncated 1075 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Require `NUM` to be a bounded positive integer before using it: ```bash QUERY="${1:-}" NUM="${2:-10}" if [[ ! "$NUM" =~ ^[1-9][0-9]*$ ]] || (( NUM > 100 )); then printf '%s\n' "NUM must be an integer from 1 to 100." >&2 exit 2 fi ``` Use the explicit `-n` option and quote the validated value: ```bash head -n "$NUM" ``` Construct the request using `curl` query-parameter encoding rather than interpolating user input directly into the URL: ```bash curl -sS --get \ --data-urlencode "wd=$QUERY" \ --data-urlencode "rn=$NUM" \ "https://www.baidu.com/s" \ -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" ``` The corrected pipeline should follow this pattern: ```bash curl -sS --get \ --data-urlencode "wd=$QUERY" \ --data-urlencode "rn=$NUM" \ "https://www.baidu.com/s" \ -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" | grep -oP '<h3 class="news-title.*?">.*?<a href="(.*?)".*?>(.*?)</a>.*?</h3>' | head -n "$NUM" ``` Additional hardening should include enabling strict shell behavior with `set -euo pipefail`, returning a nonzero status when the search pipeline fails, and testing the script with spaces, option-like values, negative numbers, oversized numbers, and file paths as the second argument. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill appears capable of using shell-like code capabilities but does not declare any tool scope or permissions boundaries. This is dangerous because it creates an implicit execution surface with no explicit least-privilege constraints, increasing the risk of unauthorized command execution, data access, or misuse if the agent runtime grants default tools.

Vague Triggers

Medium
Confidence
83% confidence
Finding
The trigger phrase includes broad conversational wording such as asking for today's anti-fraud hot topics, which may match normal user conversation unexpectedly. That can cause unintended invocation of the skill, leading to unnecessary external lookups and downstream actions such as generating and sending reports without clear user intent.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs the agent to push generated content to Feishu, but the description and invocation guidance do not clearly warn users that content may be automatically sent to an external messaging platform. This is dangerous because users may not realize their requested or collected information is being transmitted externally, creating risks of data leakage, compliance violations, and unintended distribution.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The natural-language comment and implementation describe the skill as a domestic news search script using Baidu, which hard-codes a China-specific provider and Chinese-language framing. There is no indication that this locale restriction is optional or that users can choose another language/region, which can violate language/locale policy requirements.

Static analysis

No suspicious patterns detected.