T03 · Remote Payload Retrieval and Execution
- Location
references/connect.md:42- Finding
Unverified Remote Installer Is Downloaded and Executed Through a Shell
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This StarRocks assistant is mostly purpose-aligned, but it needs review because it stores database credentials, can run database-changing SQL, and documents unsafe setup and plaintext connection patterns.
Review before installing. Use a least-privilege StarRocks account, avoid the curl | sh installer path, avoid public plaintext database connections unless you have a trusted encrypted network path, and do not rely on the skill to redact sensitive query results. Treat the local ~/.starrocks profile as stored credentials and be careful with SR_PROFILE or --profile values until profile-name validation is fixed.
references/connect.md:42Unverified Remote Installer Is Downloaded and Executed Through a Shell
scripts/sr_connect/config.py:33Unvalidated Profile Names Allow Path Traversal and Arbitrary File Operations
scripts/sr_connect/connection.py:25Database Credentials and Query Traffic Are Permitted Over Plaintext Public Connections
scripts/sr_connect/query.py:62Sensitive Query Results Are Rendered Verbatim Despite the Documented Masking Policy
The declared description promises a multi-scenario assistant with substantial StarRocks operational and development capabilities. However, the supplied code chunk is only a minimal package initializer with metadata and a docstring saying it is a base skill for StarRocks EMR Serverless access. There is no code here for connection workflows, schema design, ingestion selection, SQL analysis/tuning, or health diagnostics. Based on this chunk, the actual behavior is far narrower than the declared purpose, so this is a mismatch.
The declared description frames the skill as a broad StarRocks development/operations assistant focused on advisory scenarios such as schema design, ingestion choice, SQL tuning, execution-plan analysis, materialized views, and cluster health diagnostics. The supplied code chunk instead exposes a narrow command-line toolset for authentication/profile management, simple connection diagnosis, and executing arbitrary SQL on a StarRocks cluster. That is a materially different behavior profile: it performs actions, including query execution, rather than primarily providing guidance, and it lacks implementation for most of the described scenario coverage. While cluster connection is one listed scenario and sr-doctor loosely aligns with diagnosis, the presence of local credential management and active SQL execution are undeclared operational capabilities, and the absence of most claimed functionality makes the description inaccurate overall.
Referenced artifact was not completely inspected
l-project-root>` where `<skill-project-root>` is the directory containing this `SKILL.md` and `pyproject.toml` (the Skill's base directory shown at invocation t
Piping network content directly into sh is a classic command-chaining risk because it turns a documentation step into immediate arbitrary code execution with the user's privileges. In the context of a skill that manages local credentials under ~/.starrocks/, compromise of the installer path could lead to credential theft, tampering with CLI behavior, or broader host compromise.
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install the CLI from the skill's project root
uv tool install .
Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.
### Implementation notes
- `sr-doctor` uses standard-library `socket.create_connection` for the TCP probe (5 s timeout) and `urllib.request` for the egress IP lookup. No extra dependencies.
- Egress IP discovery uses `https://ipinfo.io/ip` (plain-text response). `api.ipify.org` and the Aliyun ECS metadata service (`100.100.100.200`) were observed to be unreliable in agenthub-style sandboxes — ipinfo.io is the only one that worked there.
- All network calls are encapsulated inside the CLI; the assistant never invokes `curl` itself, preserving the Runtime-security boundary set out in [SKILL.md](../SKILL.md#runtime-security).
## Password input guidelines
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
### 3. SQL Statement
```sql
-- Complete SQL statement, with comments on key parts
```
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
### 3. SQL Statement
```sql
-- Complete SQL statement, with comments on key parts
```
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
### 3. SQL Statement
```sql
-- Complete SQL statement, with comments on key parts
```
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
### 3. SQL Statement
```sql
-- Complete SQL statement, with comments on key parts
```
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
### 3. SQL Statement
```sql
-- Complete SQL statement, with comments on key parts
```
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
### 3. SQL Statement
```sql
-- Complete SQL statement, with comments on key parts
```
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
### 3. SQL Statement
```sql
-- Complete SQL statement, with comments on key parts
```
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
### 3. SQL Statement
```sql
-- Complete SQL statement, with comments on key parts
```
The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
The skill uses 'file_write' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
The skill uses 'network' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
selection, SQL optimization, window functions, CTEs, JOIN tuning,
materialized view design, cluster health inspection, node-down diagnosis.
Not applicable for: StarRocks instance lifecycle management
(create / scale / restart / config change / version upgrade — these are
control-plane operations, please use the EMR Serverless console or the
corresponding OpenAPI), or other Alibaba Cloud products (EMR Cluster,
Spark, Milvus, ClickHouse, Doris, RDS, ECS).
The bootstrap protocol authorizes the agent to autonomously install tooling and attempt credential initialization before obtaining explicit user consent. Even though it is limited to local skill tooling, this increases risk because the agent may alter the local environment or consume sensitive environment-provided credentials without a deliberate approval step.
When this Skill is invoked and you anticipate running any cluster query, ensure `srsql` is available *before* asking the user for anything:
1. Run `which srsql`. If it returns a path, skip to step 4.
2. If missing, install it yourself: `uv tool install <skill-project-root>` where `<skill-project-root>` is the directory containing this `SKILL.md` and `pyproject.toml` (the Skill's base directory shown at invocation time; commonly `~/.claude/skills/alibabacloud-emr-starrocks-assistant/`, which may be a symlink). **Do not ask the user to run this** — the bundled CLI is part of the Skill's capability surface, not user infrastructure.
3. If `uv` itself is missing (`which uv` fails), surface that to the user — `uv` is a system tool and not auto-installed.
4. Check `~/.starrocks/{profile}.cnf` (default profile name: `default`; respect `SR_PROFILE` env var if set). If it exists, skip to step 5. If missing:
- **First try `sr-login --from-env`.** Safe to call unconditionally — it exits 2 with a clear "missing" message when the environment doesn't have the credentials it needs, and does nothing else. You do not need to inspect environment variables yourself.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
| `sr-login` | Register a cluster credential locally + smoke-test connection | First time on a cluster, or to switch the password |
| `sr-logout` | Remove the local profile (no cluster-side action) | When done with a cluster |
| `sr-whoami` | Print profile state — host, user, login time, captured grants | Verify which cluster is active |
| `sr-doctor` | Diagnose connection failures (endpoint type, reachability, egress IP, /24 whitelist) | Automatically run by `sr-login` on failure; can also be called directly |
| `srsql` | Daily query entry point; classifies SQL and gates non-READ behind `--yes` | Run any SQL |
## Security model
L022 explicitly states that JSON is not supported by Broker Load and instructs users to use INSERT INTO ... FROM FILES() instead. Later, L225-L235 presents a JSON (v3.2.3+) section with FORMAT AS "json" as if Broker Load supports JSON, which is a direct documentation contradiction within the file.
The guide shows credential-bearing examples using access keys and secrets directly in SQL-like configuration blocks without warning that real secrets should not be embedded in statements, documentation, screenshots, query history, or logs. In this skill context, users may copy-paste these patterns into production workflows, increasing the chance of credential leakage through SQL clients, audit logs, shell history, shared notebooks, or incident tickets.
The examples embed credential fields such as usernames and passwords directly in connector configurations, including privileged defaults like root and empty passwords, without any warning to use secret management or non-production placeholders. In an operations-focused skill, users often copy examples verbatim, which can normalize insecure secret handling, lead to hardcoded credentials in source control, and encourage overprivileged database access.
The CDC guidance describes continuous replication from source systems into StarRocks, including INSERT/UPDATE/DELETE handling, but does not prominently warn that the pipeline can propagate destructive changes and sensitive records automatically once enabled. In a data-platform assistant, that omission is risky because users may enable sync against the wrong source, database, or table and unintentionally mirror deletions or regulated data into the target environment.
The documentation shows OSS access credentials being passed inline in SQL statements, which normalizes insecure secret-handling and creates a high chance that users will copy the pattern into real systems. In a development/operations assistant, examples are especially likely to be reused verbatim, so this can lead to credential exposure through query history, logs, screenshots, shared notebooks, or version control.
The example includes cloud access keys and secrets without any warning about sensitive data handling, which can mislead users into treating credentials as ordinary parameters. In SQL-centric workflows, secrets embedded in statements are commonly exposed via audit logs, client history, monitoring systems, and collaboration artifacts.
No suspicious patterns detected.