Back to skill

Security audit

Company Api

Security checks for vulnerabilities and agentic risk

Overview

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.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/api.sh:229
Finding

Arbitrary Python Code Execution Through Project Creation Arguments

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/api.sh:266
Finding

Arbitrary Python Code Execution Through Task Creation Arguments

Content
View full analysis
自动创建', 'members': []} print(json.dumps(d, ensure_ascii=False)) ") api_post "/ent/program_task" "$body" ``` ### Technical Analysis The task request body is built by embedding command-line arguments directly into executable Python source. In particular, `pid` and `uid` are inserted as unquoted Python expressions, while `name`, `start`, and `end` are inserted into single-quoted Python string literals. No numeric, date, or string escaping validation is performed. Consequently, a crafted identifier can supply an arbitrary Python expression, and a crafted string can terminate its enclosing literal and inject additional Python syntax. The resulting content is executed locally by `python3 -c`; exploitation does not depend on the remote API accepting the final request. ### Attack Path 1. An attacker supplies or influences an argument passed to `scripts/api.sh task-add`. 2. A crafted `pid` or `uid` contains a Python expression with a side effect, or a crafted string argument escapes its Python literal. 3. The shell expands the variable inside the source string passed to `python3 -c`. 4. The Python interpreter evaluates the injected expression or statement while constructing the dictionary. 5. Attacker-selected code runs with the privileges of the user or Agent executing the Skill. 6. The attacker may read credentials and tokens, manipulate local files, execute additional tools, or access internal services. ### Impact Assessment The vulnerability can provide arbitrary command execution under the current local account. The accessible scope ...[truncated 293 chars]
Remediation
View remediation
Automatically created", "members": [] } print(json.dumps(data, ensure_ascii=False)) PY ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/api.sh:325
Finding

Plaintext Credentials Stored Without Enforced Restrictive Permissions

Content
View full analysis
"$CONFIG_FILE" << EOF { "base_url": "$base_url", "access_key": "$ak", "secret_key": "$sk", "account": "$acct", "password": "$pwd" } EOF echo "" echo "✅ Configuration saved to: $CONFIG_FILE" echo " The API commands are now ready for use" ``` ### Technical Analysis The setup process persistently stores the account password, access key, and secret key in `.api-config.json` as plaintext. The script does not establish a restrictive umask before creating the file and does not apply `chmod 600` afterward. The resulting permissions therefore depend on the invoking process's environment. With a common umask of `022`, a newly created regular file is typically mode `0644`, making the credentials readable by other local users. The token cache is also created through temporary files and moved into place without an explicit final permission check. The documentation warns users not to share the files, but this warning does not enforce operating-system access controls and does not prevent local disclosure. ### Attack Path 1. A user runs the setup command and provides valid company API credentials. 2. The script writes those credentials in plaintext to `.api-config.json`. 3. The file is created according to the inherited umask rather than a security policy enforced by the script. 4. On a multi-user host or shared workspace, another local user or process reads the configuration file. 5. The exposed password, access key, and secret key are used to authenticate to the company platform. 6. Cached bearer tokens may similarly be recovered from `.token-cache.json` if its permissions are permissive. ### Impact Assessment An attacker who can read the files obtains reusable authentication material. Depending on the associated account's server-side permissions, t ...[truncated 389 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/api.sh:290
Finding

Credentials and Bearer Tokens Can Be Transmitted Over Plain HTTP

Content
View full analysis
/dev/null)${ep}?${q}" \ -H "accept: application/json" \ -H "authorization: Bearer $t" \ -H "user-agent: Mozilla/5.0") ``` ### Technical Analysis Although the interactive prompt presents an HTTPS example, the script only checks that `base_url` is nonempty. It does not parse the URL or require the `https` scheme. A user can therefore configure an `http://` endpoint. When plain HTTP is used, the access key, secret key, account password, bearer tokens, API request parameters, response bodies, and company data are transmitted without transport encryption or server authentication. A network-positioned attacke ...[truncated 1429 chars]
Remediation
View remediation
&2 return 1 ;; esac ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

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.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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/api.sh (reported line 57)May include surrounding context.

sh
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')

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

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.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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/api.sh (reported line 81)May include surrounding context.

sh
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\"}")

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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/api.sh (reported line 138)May include surrounding context.

sh
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过期则重新登录重试

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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/api.sh (reported line 144)May include surrounding context.

sh
# 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

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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/api.sh (reported line 306)May include surrounding context.

sh
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 "✅ 开放平台验证通过"

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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/api.sh (reported line 315)May include surrounding context.

sh
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 "✅ 用户登录验证通过"

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

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.

Content

No source excerpt is available for this finding.