Back to skill

Security audit

MGC Cross-Region Migration

Security checks for vulnerabilities and agentic risk

Overview

This migration tool needs review because its code can change server access, expose SSH, and switch billing projects beyond its stated safeguards.

Have an administrator review this before production use. Approve exact destination server IDs and billing projects, take backups, protect target SSH files, enforce host verification, and restrict inbound SSH. Require approval before deleting migration history or changing DNS, and define VPN cleanup. Keep configuration trusted and credentials narrowly scoped. Static inspection resolved the reported reference gap; live cloud behavior was not tested. The evidence supports Review, without establishing malicious intent.

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

Error
Location
.
Finding

SSH server identity verification is disabled during credential authentication and filesystem migration

Content
View full analysis

Impact

A fake source SSH server can collect the source login password. A fake target can receive the migrated filesystem, including sensitive files present in the selected migration scope. The private key itself is not transmitted by normal SSH public-key authentication.

T09 · Insecure Skill Coding Practices

Error
Location
.
Finding

Destructive migration paths do not enforce the documented confirmation requirement

Content
View full analysis

Impact

An existing matching ECS can have its filesystem overwritten and target-only files deleted without approval tied to that specific server. The AWS direct workflow can also reboot its target without an execution-time approval gate.

T09 · Insecure Skill Coding Practices

Warning
Location
.
Finding

AWS migration automatically exposes target SSH to the entire Internet

Content
View full analysis

Impact

The target SSH service becomes reachable by unauthorized external peers, enabling scanning, authentication attempts, and exposure to SSH service vulnerabilities. This does not by itself establish successful login or host compromise.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (49)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 170)May include surrounding context.

md
过程的问题总结", "经验复盘", "踩坑记录", or "postmortem", load [references/lessons-learned.md](references/lessons-learned.md) and report in this order:

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 184)May include surrounding context.

md
- [references/lessons-learned.md](references/lessons-learned.md) — structured migration issue summary (`symptom -> root cause -> action -> prevention`) and reus

The rsync transfer can overwrite SSH authorization and configuration despite explicitly claiming never to modify them.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The root-filesystem rsync does not exclude authorized_keys, sshd_config, SSH configuration snippets, or host keys, so it can overwrite target SSH security state despite the explicit assurance. Running the transfer as root and subsequently rebooting can activate inherited access policies, permit source-authorized users to access the target, or lock out the migration operator.

Content

No source excerpt is available for this finding.

The claim that rsync never writes authorized_keys or modifies sshd_config is contradicted by the root-filesystem transfer.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The root-to-root transfer includes SSH authorization files and daemon configuration because the exclusion list does not protect them. This contradicts the assurance and can replace target access controls with source policies, grant inherited access, or cause operator lockout; daemon configuration changes can take effect on a later restart or reboot.

Content

No source excerpt is available for this finding.

ECS provisioning automatically switches enterprise projects after a budget rejection.

High
Category
Excessive Agency
Confidence
94% confidence
Finding

Following an enterprise-project budget rejection, provisioning automatically retries under project 0 or with the enterprise project omitted. With broadly authorized cloud credentials, this can circumvent the intended project's budget governance and allocate resources under a different billing or administrative scope, although it does not bypass IAM authorization.

Content

No source excerpt is available for this finding.

The rsync fallback can overwrite SSH trust and configuration despite explicitly promising never to modify them.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The default root-filesystem rsync uses --delete and does not exclude authorized_keys, SSH host keys, or sshd configuration, contradicting the stated guarantee that SSH trust and configuration remain untouched. It can import unwanted source access credentials, duplicate host identities, remove target-only authorized keys, or lock operators out during migration.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · README.md (reported line 27)May include surrounding context.

cp terraform.tfvars.example terraform.tfvars

edit terraform.tfvars

terraform init terraform apply -auto-approve

text

Result file:

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/migration-skill-summary.md (reported line 15)May include surrounding context.

md
1. Validate source registration/permissions/target image/quota.
2. Populate `terraform.tfvars` with migration, network, and optional VPN/rsync parameters.
3. Run `terraform init` then `terraform apply -auto-approve`.
4. If apply reports `No changes`, force rerun with:
   - `terraform apply -replace=terraform_data.mgc_region_migration -auto-approve`
5. Confirm run output from:

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/reuse-bundle.md (reported line 28)May include surrounding context.

md
# Initialize and apply Terraform
terraform init
terraform apply -auto-approve

# If apply returns "No changes", force rerun with:
terraform apply -replace=terraform_data.mgc_region_migration -auto-approve

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/runbook.md (reported line 123)May include surrounding context.

md
- `VPC.0114`
  - Meaning: target-region VPC/router quota exceeded when creating target VPC.
  - Action: release one unused VPC or increase quota, then rerun `terraform apply -auto-approve`.

- `SMS.7703`
  - Meaning: queried `task_id` does not exist (often from stale historical output file).

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · README.md (reported line 48)May include surrounding context.

md
- `VPC.0114`
  - Meaning: target region VPC quota exceeded when creating `vpc-migration`.
  - Action: delete an unused VPC or increase quota, then rerun `terraform apply -auto-approve`.

- `SMS.7703`
  - Meaning: queried `task_id` does not exist (commonly a stale ID from older output).

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/lessons-learned.md (reported line 16)May include surrounding context.

md
- Symptom: `terraform apply` fails while creating target VPC (`vpc-migration`) in `la-south-2`.
- Root cause: target-region VPC quota is full (`used == quota`).
- Corrective action: delete one unused VPC or increase VPC quota, then rerun `terraform apply -auto-approve`.
- Prevention: check VPC quota before every apply when VPC may be auto-created.

### `SMS.7703` (task does not exist)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 75)May include surrounding context.

bash
terraform init
terraform apply -auto-approve

If apply returns No changes for terraform_data.mgc_region_migration (same run fingerprint), force one execution:

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/acceptance-criteria.md (reported line 7)May include surrounding context.

md
## CLI/Command Format

- ✅ `terraform init` and `terraform apply -auto-approve` are run from the repository root, in that order.
- ✅ `terraform apply -replace=terraform_data.mgc_region_migration -auto-approve` is used only when a normal apply reports `No changes` but a rerun is actually required.
- ❌ Running `python scripts/mgc_migrate.py` directly with hand-typed environment variables instead of letting Terraform map `terraform.tfvars`, which risks drift between declared inputs and actual run.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 81)May include surrounding context.

If apply returns No changes for terraform_data.mgc_region_migration (same run fingerprint), force one execution:

bash
terraform apply -replace=terraform_data.mgc_region_migration -auto-approve

Terraform's local-exec maps tfvars into runtime env vars and calls:

Cleanup instructions delete historical migration tasks and projects without warning about loss of migration records.

Medium
Category
Output Handling
Confidence
92% confidence
Finding

The workflow directs deletion of historical tasks, including successful ones, and old migration projects without requiring archival, dependency checks, or approval of the exact deletion set. The explicit confirmation safeguards elsewhere concern target overwrites and restarts, leaving this cleanup path able to remove operational history or records still needed by other workflows.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/acceptance-criteria.md (reported line 8)May include surrounding context.

md
## CLI/Command Format

- ✅ `terraform init` and `terraform apply -auto-approve` are run from the repository root, in that order.
- ✅ `terraform apply -replace=terraform_data.mgc_region_migration -auto-approve` is used only when a normal apply reports `No changes` but a rerun is actually required.
- ❌ Running `python scripts/mgc_migrate.py` directly with hand-typed environment variables instead of letting Terraform map `terraform.tfvars`, which risks drift between declared inputs and actual run.

## Parameter Validation

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/lessons-learned.md (reported line 35)May include surrounding context.

md
### Terraform `No changes` on rerun

- Symptom: `terraform apply -auto-approve` returns `No changes` and does not trigger migration again.
- Root cause: `terraform_data.mgc_region_migration` trigger fingerprint did not change from previous successful run.
- Corrective action: run `terraform apply -replace=terraform_data.mgc_region_migration -auto-approve`.
- Prevention: for deliberate reruns with same tfvars, use `-replace` explicitly.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/lessons-learned.md (reported line 37)May include surrounding context.

md
- Symptom: `terraform apply -auto-approve` returns `No changes` and does not trigger migration again.
- Root cause: `terraform_data.mgc_region_migration` trigger fingerprint did not change from previous successful run.
- Corrective action: run `terraform apply -replace=terraform_data.mgc_region_migration -auto-approve`.
- Prevention: for deliberate reruns with same tfvars, use `-replace` explicitly.

### `SMS.6603` (source not connected)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/runbook.md (reported line 119)May include surrounding context.

md
- `SMS.8115`
  - Meaning: migration-project quota reached (max 50).
  - Action: delete old migration projects (prefer auto-generated `mgc*` projects), then rerun `terraform apply -auto-approve`.

- `VPC.0114`
  - Meaning: target-region VPC/router quota exceeded when creating target VPC.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/lessons-learned.md (reported line 79)May include surrounding context.

md
- Symptom: creating migration project fails with `The quantity of MigProject must be lower than or equal to 50`.
- Root cause: accumulated historical migration projects reached platform quota (`count=50`).
- Corrective action: delete old migration projects (prefer auto-generated `mgc*` items), then rerun `terraform apply -auto-approve`.
- Prevention: add migration-project quota check/cleanup before each large rerun batch.

### SSH `connection reset/closed/timed out` after rsync cutover

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · references/runbook.md (reported line 153)May include surrounding context.

md
3. Check VPC quota in target region (common blocker for `vpc-migration` creation).
4. Re-check region names and image ID.
5. Check SMS migration-project quota; if `SMS.8115`, clean old migration projects first.
6. Re-run `terraform apply -auto-approve` after fixing input.
7. Keep previous failure output for comparison; do not delete diagnostics blindly.

## If Task Starts But Progress Is Unclear