T09 · Insecure Skill Coding Practices
- Location
scripts/api.sh:229- Finding
Arbitrary Python Code Execution Through Project Creation Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears to be a real company API helper, but it handles powerful business credentials and write operations with unsafe storage, transport, and input-handling choices.
Review before installing. Use only with least-privilege company API credentials, only against a trusted HTTPS endpoint, and avoid running mutating commands until input handling and confirmation gates are fixed. Do not use this on shared machines unless secret files are protected, and rotate any credentials previously stored by this script if file exposure is possible.
scripts/api.sh:229Arbitrary Python Code Execution Through Project Creation Arguments
scripts/api.sh:266Arbitrary Python Code Execution Through Task Creation Arguments
scripts/api.sh:325Plaintext Credentials Stored Without Enforced Restrictive Permissions
scripts/api.sh:290Credentials and Bearer Tokens Can Be Transmitted Over Plain HTTP
The description presents the skill primarily as a query/integration tool, but the documented commands also create projects, tasks, and products and persist credentials and tokens locally. This mismatch can mislead users or automated reviewers into granting trust or running the skill without realizing it performs state-changing operations and local secret storage, creating a substantial risk of unauthorized business changes and credential exposure.
The skill metadata says it is for querying internal company data, but the script also exposes a product creation command. That mismatch is security-relevant because users may grant or run the skill expecting read-only behavior while it can perform state-changing operations against internal business systems.
This section creates projects even though the skill description emphasizes data querying. Hidden or under-disclosed write access to project-management APIs can be abused to create unauthorized records, trigger workflows, or confuse business operations under the user's credentials.
The code supports task creation while the stated purpose centers on querying company data. That capability expansion makes the skill more dangerous in context because a user may unknowingly authorize actions that alter internal systems, assign work, or create operational noise.
The setup flow collects access keys, secret keys, account names, and passwords, then writes them into a local JSON file in plaintext without warning. Plaintext local storage of multiple high-value credentials is dangerous because any local compromise, accidental sharing, backup leak, or permissive file permissions can expose broad access to internal systems.
The skill exposes shell-based operational capabilities but does not declare any tool scope or execution permissions, which weakens reviewability and allows broader-than-expected command execution in environments that rely on manifest metadata for policy enforcement. Because the skill handles internal company data and credentialed API access, undeclared shell usage increases the risk of unintended or over-privileged execution.
The command list includes multiple data-modifying operations that create company records, but the documentation does not clearly warn that these commands will mutate production business data. In an internal company API context covering projects, contracts, customers, and products, lack of prominent warning raises the chance of accidental or socially engineered misuse with real operational consequences.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if [ "$(date +%s)" -lt "$exp" ] && [ -n "$t" ]; then echo "$t"; return 0; fi
fi
local r; r=$(curl -s -X POST "$base_url/open/auth/login" \
-H "Content-Type: application/json" \
-d "{\"access_key\":\"$ak\",\"secret_key\":\"$sk\"}")
local s; s=$(echo "$r" | jq -r '.status')
The script automatically transmits stored account credentials to a remote API for login, but gives no user-facing warning at the point of use. In the context of an internal-company-data skill, silent credential transmission increases the risk of users exposing sensitive credentials to an untrusted or misconfigured base URL.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
do_login() {
local api_base; api_base=$(jq -r '.base_url // ""' "$CONFIG_FILE" 2>/dev/null)
load_config
local r; r=$(curl -s -X POST "${api_base}/ent/user/login" \
-H "accept: application/json" -H "content-type: application/json" \
-H "user-agent: Mozilla/5.0" \
-d "{\"account\":\"$ACCOUNT\",\"password\":\"$PASSWORD\"}")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
api_post() {
local ep="$1" body="$2" t result
t=$(get_user_token 2>/dev/null) || t=$(do_login 2>/dev/null) || return 1
result=$(curl -s -X POST "$(jq -r ".base_url" "$CONFIG_FILE" 2>/dev/null)${ep}" \
-H "accept: application/json" -H "content-type: application/json" \
-H "authorization: Bearer $t" -H "user-agent: Mozilla/5.0" -d "$body")
# Token过期则重新登录重试
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Token过期则重新登录重试
if echo "$result" | jq -e '.status == 410003 or (.message // "") | test("Login expired|登录过期")' >/dev/null 2>&1; then
t=$(do_login 2>/dev/null) || return 1
curl -s -X POST "$(jq -r ".base_url" "$CONFIG_FILE" 2>/dev/null)${ep}" \
-H "accept: application/json" -H "content-type: application/json" \
-H "authorization: Bearer $t" -H "user-agent: Mozilla/5.0" -d "$body"
else
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
echo "正在验证...请稍候"
# 先尝试开放平台登录
local r; r=$(curl -s -X POST "$base_url/open/auth/login" -H "Content-Type: application/json" -d "{"access_key":"$ak","secret_key":"$sk"}")
local s; s=$(echo "$r" | jq -r '.status')
if [ "$s" = "200" ]; then
echo "✅ 开放平台验证通过"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
fi
# 尝试用户登录
r=$(curl -s -X POST "$base_url/ent/user/login" -H "accept: application/json" -H "content-type: application/json" -H "user-agent: Mozilla/5.0" -d "{"account":"$acct","password":"$pwd"}")
s=$(echo "$r" | jq -r '.status')
if [ "$s" = "200" ]; then
echo "✅ 用户登录验证通过"
The save-token command allows manual injection and caching of an arbitrary bearer token without validation or strong justification for the advertised query use case. This can facilitate credential misuse, session swapping, or persistence of privileged tokens in local files, especially in shared environments.
Natural-language strings such as the description and usage/setup prompts are presented solely in Chinese, with no option for another language or indication that the skill is intentionally region-specific. This can violate a language/locale policy when a skill mandates one language without opt-in or documented justification.