Back to skill

Security audit

3X-UI代理面板

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent 3x-ui administration helper, but it exposes powerful panel operations and handles admin tokens without enough safety guidance or transport safeguards.

Install only if you are comfortable giving an agent administrative access to your 3x-ui panel. Use a narrowly scoped token where possible, avoid passing tokens on the command line, require HTTPS panel URLs, review every destructive action before execution, and treat backups, logs, config output, subscription links, and Telegram backup destinations as sensitive.

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

Warning
Location
scripts/add_user.sh:3
Finding

Bearer Tokens Exposed Through Command-Line Arguments

Content
View full analysis
# 示例: ./add_user.sh https://panel.example.com:2053 "Bearer eyJ..." user@example.com 50 30 "[3,5]" PANEL_URL="$1" TOKEN="$2" ``` ```bash # scripts/list_users.sh:3-7 # 用法: ./list_users.sh # 示例: ./list_users.sh https://panel.example.com:2053 "Bearer eyJ..." PANEL_URL="$1" TOKEN="$2" ``` ```bash # scripts/online_users.sh:3-6 # 用法: ./online_users.sh PANEL_URL="$1" TOKEN="$2" ``` ```bash # scripts/server_status.sh:3-7 # 用法: ./server_status.sh # 示例: ./server_status.sh https://panel.example.com:2053 "Bearer eyJ..." PANEL_URL="$1" TOKEN="$2" ``` ### Technical Analysis All four scripts require a bearer token to be supplied as a positional command-line argument. Command-line arguments are not a secure credential transport mechanism because they may be: - Saved in interactive shell history. - Recorded by terminal management, auditing, or monitoring software. - Visible in process listings while the script is running, subject to operating-system process visibility controls. - Exposed in automation logs, job definitions, troubleshooting output, or copied command examples. The scripts subsequently place this token in the `Authorization` header. A disclosed token can therefore be replayed without knowing the administrator's password. The project's API documentation indicates that bearer tokens can authenticate administrative panel endpoints. The actual impact depends on the permissions assigned to the exposed token and the panel's access controls. ### Attack Path 1. An admin ...[truncated 1046 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/list_users.sh:15
Finding

Bearer Tokens Can Be Transmitted Over Plaintext HTTP

Content
View full analysis
/dev/null; then echo "" echo "=== 订阅链接 ===" curl -s -X GET "${PANEL_URL}/panel/api/clients/links/${EMAIL}" \ -H "Authorization: ${TOKEN}" \ ``` ```bash # scripts/list_users.sh:15-17 curl -s -X GET "${PANEL_URL}/panel/api/clients/list" \ -H "Authorization: ${TOKEN}" \ -H "Accept: application/json" | python3 -m json.tool ``` ```bash # scripts/online_users.sh:14-16 curl -s -X POST "${PANEL_URL}/panel/api/clients/onlines" \ -H "Authorization: ${TOKEN}" \ -H "Accept: application/json" | python3 -c " ``` ```bash # scripts/server_status.sh:16-18 curl -s -X GET "${PANEL_URL}/panel/api/server/status" \ -H "Authorization: ${TOKEN}" \ -H "Accept: application/json" | python3 -c " ``` ### Technical Analysis The scripts concatenate the caller-controlled `PANEL_URL` directly into each request and do not enforce an HTTPS scheme. Although the documentation examples use HTTPS, a caller can supply an `http://` URL. When HTTP is used, the `Authorization` header and API response travel without transport encryption or endpoint authentication. ...[truncated 1431 chars]
Remediation
View remediation
&2 exit 1 ;; esac ``` - Allow plaintext HTTP only through an explicit, prominently documented development override restricted to loopback addresses. - Continue using curl's default TLS certificate and hostname verification. - Do not introduce `-k` or `--insecure`. - Normalize the URL and reject embedded user information, malformed schemes, and unexpected control characters. - Consider restricting permitted panel hosts in automation deployments. - Use a private CA bundle through `--cacert` when panels rely on an internal certificate authority. - Rotate any token that may previously have been sent over plaintext HTTP. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/add_user.sh:32
Finding

Untrusted Arguments Are Interpolated Directly into an Administrative JSON Request

Content
View full analysis
Remediation
View remediation
&2 exit 1 fi if ! jq -e 'type == "array" and all(.[]; type == "number" and floor == . and . >= 0)' \ >/dev/null 2>&1 <<<"$INBOUND_IDS"; then echo "Error: inbound_ids must be a JSON array of non-negative integers." >&2 exit 1 fi PAYLOAD=$(jq -n \ --arg email "$EMAIL" \ --argjson totalGB "$TOTAL_BYTES" \ --argjson expiryTime "$EXPIRY_TS_MS" \ --argjson inboundIds "$INBOUND_IDS" \ '{ client: { email: $email, totalGB: $totalGB, expiryTime: $expiryTime, tgId: 0, limitIp: 0, enable: true }, inboundIds: $inboundIds }') ``` - Pass the serialized payload with `--data-binary "$PAYLOAD"`. - Validate email length and syntax according to the panel's accepted identifier rules. - Apply upper bounds to traffic, expiry duration, and inbound-array length to prevent overflow and unreasonable administrative requests. - If called by another application, pass structured values rather than accepting an arbitrary raw JSON fragment. - Verify requested inbound IDs against an operator-approved allowlist before creating the client. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (18)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/add_user.sh (reported line 32)May include surrounding context.

sh
echo "入站: $INBOUND_IDS"
echo ""

RESPONSE=$(curl -s -X POST "${PANEL_URL}/panel/api/clients/add" \
  -H "Authorization: ${TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/add_user.sh (reported line 54)May include surrounding context.

sh
if echo "$RESPONSE" | python3 -c "import json,sys; d=json.load(sys.stdin); sys.exit(0 if d.get('success') else 1)" 2>/dev/null; then
  echo ""
  echo "=== 订阅链接 ==="
  curl -s -X GET "${PANEL_URL}/panel/api/clients/links/${EMAIL}" \
    -H "Authorization: ${TOKEN}" \
    -H "Accept: application/json" | python3 -c "
import json, sys

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/list_users.sh (reported line 15)May include surrounding context.

sh
exit 1
fi

curl -s -X GET "${PANEL_URL}/panel/api/clients/list" \
  -H "Authorization: ${TOKEN}" \
  -H "Accept: application/json" | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/online_users.sh (reported line 14)May include surrounding context.

sh
fi

echo "=== 在线用户 ==="
curl -s -X POST "${PANEL_URL}/panel/api/clients/onlines" \
  -H "Authorization: ${TOKEN}" \
  -H "Accept: application/json" | python3 -c "
import json, sys

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/server_status.sh (reported line 16)May include surrounding context.

sh
fi

echo "=== 服务器状态 ==="
curl -s -X GET "${PANEL_URL}/panel/api/server/status" \
  -H "Authorization: ${TOKEN}" \
  -H "Accept: application/json" | python3 -c "
import json, sys

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill documents shell-based workflows in scripts/ but declares no permissions or allowed-tools scope, leaving an agent free to invoke shell actions without an explicit least-privilege boundary. In a skill that administers a proxy control panel, shell access materially increases the chance of unintended destructive actions, credential exposure, or host-level compromise beyond the intended REST API surface.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill exposes sensitive operations like downloading the SQLite database backup, viewing the live Xray configuration, and fetching panel/Xray logs without any privacy or secret-handling guidance. Those endpoints can reveal credentials, API tokens, subscription identifiers, client data, network topology, and other sensitive operational details, making accidental disclosure by an agent especially dangerous.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This section lists high-impact administrative actions such as stopping/restarting services, installing or updating components, importing databases, and retrieving logs, but provides no warning or confirmation guidance. In an agent setting, that omission can normalize unsafe execution of destructive operations and lead to service outage, configuration corruption, or irreversible state changes from a simple user prompt or misunderstanding.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

These lines document an endpoint to download the server's SQLite database file, which likely contains sensitive configuration and user records. The markdown provides no warning about the sensitivity of the backup contents or the need to protect the exported file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file documents a database restore endpoint but does not warn that importing a database can replace current configuration and operational data. For markdown files, destructive or system-integrity-affecting behaviors should include explicit user-facing warnings.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This endpoint sends database backups externally to Telegram, which is a network transmission of potentially sensitive user and system data. The documentation does not warn about privacy, retention, or the need to ensure the bot/chat destination is trusted.

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/add_user.sh (reported line 32)May include surrounding context.

sh
echo "入站: $INBOUND_IDS"
echo ""

RESPONSE=$(curl -s -X POST "${PANEL_URL}/panel/api/clients/add" \
  -H "Authorization: ${TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script requires a bearer token to be supplied as a positional command-line argument, which can expose the secret through shell history, process listings such as ps, audit logs, and CI job output. In the context of a 3x-ui administration skill, that token likely grants panel access for user and server management, so leakage could enable unauthorized administrative API actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This is a code file, so SQP-2 applies to network calls and credential handling. The script posts to a remote panel endpoint and sends the token in an Authorization header, but aside from basic usage text there is no warning, comment, or disclosure that sensitive credentials and user-related data are being transmitted.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script requires a bearer token as a command-line argument and sends it in an HTTP Authorization header. Although the usage comment shows how to supply the token, it does not warn that passing credentials on the command line may expose them via shell history or process listings, and there is no other user disclosure about this sensitive operation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The comments and console messages are written in Chinese throughout the script, including usage/help output and status messages. This imposes a specific language on users without any opt-in or documented region-specific justification, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

All natural-language comments and usage/help output are presented only in Chinese, with no option for another language or indication that the script is intentionally region-specific. This can violate language/locale policy where user-facing text must not force a specific language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

Comments, usage text, and runtime output are all written in Chinese, which imposes a specific language on users without opt-in. The file does not indicate that the skill is intentionally limited to a Chinese-speaking or region-specific environment.

Content

No source excerpt is available for this finding.