T09 · Insecure Skill Coding Practices
- Location
scripts/client.py:32- Finding
Unvalidated API Endpoint Override Exposes Credential Material and Workload Data
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Oceanus operations skill is not evidently malicious, but it should be reviewed because it can change TencentCloud resources and has under-scoped credential and upload paths.
Review before installing. Use least-privilege and preferably short-lived TencentCloud credentials, avoid storing permanent keys in shell profiles, do not set OCEANUS_ENDPOINT unless you fully trust the destination, validate any COS upload/download URLs before sharing or using them, and manually confirm every resource-changing operation.
scripts/client.py:32Unvalidated API Endpoint Override Exposes Credential Material and Workload Data
scripts/resource_management.py:221Local Files Can Be Uploaded to an Unvalidated Presigned URL
references/credential-setup.md:33Long-Lived Cloud Credentials Are Persisted in Plaintext
The request destination is derived from the OCEANUS_ENDPOINT environment variable and then used to build the signed request URL and Host header. In an agent or automation context, environment variables are part of the execution trust boundary; if an attacker can influence them, they can redirect requests to an arbitrary host and receive authenticated API payloads and headers, enabling SSRF-style egress and possible credential/signature misuse against a malicious endpoint.
headers=headers,
method="POST",
)
resp = urlopen(req, timeout=max(connect_timeout, read_timeout))
resp_body = json.loads(resp.read().decode("utf-8"))
except HTTPError as e:
body = e.read().decode("utf-8") if e.fp else ""
Referenced artifact was not completely inspected
- `scripts/unit_test.py` — offline unit tests for pure-logic helpers (no network / no credentials). Run via `python scripts/unit_test.py` or `python -m unittest
The phrase 'bypass safety check' explicitly instructs the operator to override a protective control for mutation/destructive operations. In an operational skill that can create, modify, run, and stop production Oceanus jobs, normalizing safety-bypass language increases the chance that an agent or user treats confirmation as a mere formality rather than a deliberate authorization step.
--confirm # Required flag to bypass safety check
This wording functions like an instruction to override a safety mechanism by presenting --confirm as the way to get past protections. Even though it is documentation rather than executable code, agent skills use such mappings operationally, so this can steer downstream automation to append --confirm routinely and suppress meaningful human-in-the-loop checks.
--confirm # Required flag to bypass safety check
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
--confirm # Required flag to bypass safety check
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
| `TENCENTCLOUD_SECRET_KEY` | Yes | Matching secret key |
| `TENCENTCLOUD_SECURITY_TOKEN` | Only for STS | Temporary credential token |
Get keys from the [腾讯云 CAM 控制台](https://console.cloud.tencent.com/cam/capi).
## Persistent configuration templates by OS
Without declared permissions the skill's intent is opaque and cannot be validated.
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.
"不用确认草稿". Implied urgency or convenience is NOT sufficient.
2. When the draft summary is displayed, you MUST present it to the user and
**wait for explicit approval** ("确认发布", "OK", "没问题", "发布吧")
before proceeding. Do NOT auto-approve on behalf of the user.
3. If the CLI outputs the draft to a temporary file, read and display the
key changes (SQL diff / resource changes / config deltas) to the user.
4. Violation of this gate is a **critical protocol breach** — equivalent to
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.
3. If the CLI outputs the draft to a temporary file, read and display the
key changes (SQL diff / resource changes / config deltas) to the user.
4. Violation of this gate is a **critical protocol breach** — equivalent to
executing a destructive operation without consent.
- `--skip_draft_confirm`: skip the review (**automation-only flag**; agent
must NEVER use it unless user explicitly opted out of review).
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.
1. NEVER read, print, or echo their values (no `echo $TENCENTCLOUD_*`,
`env | grep TENCENT`, `printenv`, …).
2. NEVER ask the user to paste keys into chat. Have them configure locally.
3. Never embed credentials in command arguments or generated files. The CLI
reads them from the environment.
4. If a tool result accidentally surfaces a credential value, redact it
The protocol classifies check_sql as both a read operation and a write operation that modifies draft state, creating ambiguity about whether side effects occur. In an agentic execution setting, that inconsistency can cause the agent to run a state-changing command under weaker safeguards than intended, leading to unauthorized or unexpected modifications.
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.
- Folder: `describe_folder`, `query_folder`
- Resource: `describe_tree_resources`, `create_presigned_url`
**Rule**: Execute immediately without confirmation.
### Mutation Operations (create/modify resources)
- Job: `create_job`, `create_job_config`, `run_jobs`, `trigger_savepoint`
Treating a broad direct-imperative phrase like "帮我创建" as implicit approval weakens the explicit confirmation barrier for mutation operations. An attacker or ambiguous prompt can trigger resource creation without a distinct consent step, especially in multi-turn conversations where user intent may be inferred incorrectly.
The protocol explicitly allows modify_draft and check_sql to execute without confirmation because they are considered safe, even though at least one of them modifies draft state. Removing confirmation for state-changing actions enables silent changes to user assets or configurations, which is especially risky in an agent that may act on ambiguous user instructions.
**Rule**: Require `--confirm` flag. If user gives direct imperative ("帮我创建"), treat as approved.
### Write Operations (safe, no confirmation needed)
- `modify_draft`, `check_sql`
**Rule**: Execute directly (no `--confirm`). These modify draft state but are safe / idempotent.
This markdown file documents the delete_folders command as destructive but does not include any user-facing warning, safeguard note, or confirmation requirement in the description. For markdown files, destructive behaviors that could affect user data or system integrity should be accompanied by explicit warnings.
The stop_jobs command is marked as destructive, but the catalog entry does not warn users that stopping running jobs may interrupt workloads or affect system state. In markdown documentation, potentially disruptive operations should include clear user warnings.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
export TENCENTCLOUD_SECRET_KEY="你的SecretKey"
EOF chmod 600 ~/.zshrc source ~/.zshrc
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
export TENCENTCLOUD_SECRET_KEY="你的SecretKey"
EOF chmod 600 ~/.zshrc source ~/.zshrc
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
export TENCENTCLOUD_SECRET_KEY="你的SecretKey"
EOF chmod 600 ~/.zshrc source ~/.zshrc
The fish-shell template persists long-lived cloud credentials to disk in a shell startup file, which increases the exposure window if the local account, backups, dotfile sync, or developer tooling are compromised. Although the file recommends restrictive permissions and never pasting secrets into chat, persistent plaintext storage of access keys is still a real security concern in an ops skill context.
~/.config/fish/conf.d/tencentcloud.fishmkdir -p ~/.config/fish/conf.d
cat > ~/.config/fish/conf.d/tencentcloud.fish <<'EOF'
set -gx TENCENTCLOUD_SECRET_ID "你的SecretId"
set -gx TENCENTCLOUD_SECRET_KEY "你的SecretKey"
The section is explicitly titled 'Reusable Chinese reply template' and mandates a Chinese response template for the agent. This is a natural-language locale constraint, but the file does not offer user opt-in or explain a justified region-specific requirement, which fits the language/locale policy violation category.
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.
| Code | Meaning | Recovery |
|------|---------|----------|
| MissingCredentials | Env vars not set | **Stop execution** and guide the user to persist credentials in a shell/OS config file based on their OS (macOS → `~/.zshrc`; Linux bash → `~/.bashrc`; fish → `~/.config/fish/conf.d/*.fish`; Windows → `setx` / `[Environment]::SetEnvironmentVariable(... "User")`). Never ask the user to paste secrets into chat, never echo/print env vars, and never write keys to repo files. See `references/credential-setup.md` for the full per-OS template and the `MissingCredentials` recovery flow. |
| ValidationError | Required parameter missing | Add the missing --parameter |
| SafetyCheckRequired | Mutation without --confirm | Add --confirm flag |
| Cancelled | User cancelled interactively | Re-run with --confirm if intended |
This markdown file uses Chinese throughout its operational instructions, examples, and error guidance, which effectively forces a specific language for users. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific; that justification is not stated here.
The playbook instructs users to generate pre-signed COS download URLs for job logs but does not warn that these URLs confer temporary direct access to potentially sensitive operational data and can be shared or leaked via terminals, chat, tickets, or shell history. In an observability/ops context, logs often contain stack traces, identifiers, endpoints, and occasionally secrets, so omission of handling guidance materially increases the chance of unintended disclosure.
This markdown file contains user-facing operational instructions in Chinese and does not indicate that language selection is optional. The policy explicitly calls for flagging language or locale constraints when a skill forces a specific language without user opt-in.