Back to skill

Security audit

Aws Best Practice Research

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate AWS best-practice purpose, but its live assessment path tells agents to source user-provided credential files and collect broad AWS configuration data without enough safeguards.

Review this skill before installing. Use it only with least-privilege read-only AWS credentials, avoid providing credential files to be sourced, and prefer preconfigured AWS profiles or environment variables. Expect live assessment to collect infrastructure metadata such as topology, tags, events, subnet details, and security settings; avoid running it on accounts where unrelated resource inventory should not enter agent context or logs.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:229
Finding

Arbitrary Shell Execution Through Credential-File Sourcing

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:229-235
Vulnerability Type: Unsafe shell evaluation of a user-supplied credential file
Risk Level: High

Vulnerable code:

markdown
#### 8.1 Prepare Environment

If the user provided a credential file path (e.g., `env.sh`), source it:
```bash
source <credential-file-path>

Verify access by running a simple describe command against the target service and region.

text

### Technical Analysis

The `source` shell built-in executes a file in the current shell process. It does not distinguish environment-variable declarations from arbitrary shell commands. Consequently, a file presented as an AWS credential file can contain command substitutions, function calls, filesystem operations, network commands, or other executable statements.

The instructions do not require the Agent to validate the path, inspect the file, restrict its syntax, obtain confirmation after displaying its contents, or isolate its execution. Because execution occurs in the current process, the file can also modify shell options, command lookup behavior, environment variables, and subsequent AWS CLI execution.

### Attack Path

1. An attacker creates or modifies a file represented as an AWS credential file.
2. The file contains legitimate-looking AWS environment declarations followed by arbitrary shell commands.
3. The attacker persuades a user to provide that file path for a live assessment, or places the file at a path the user already trusts.
4. The Agent follows Step 8.1 and runs `source <credential-file-path>`.
5. All statements in the file execute with the OS permissions of the Agent process.
6. The malicious statements can access local files, alter the assessment environment, invoke external programs, or interfere with later AWS CLI operations.

### Impact Assessment

Successful exploitation provides arbitrary command execution with the privileges of the account 
...[truncated 337 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove the instruction to execute credential files with source.
  • Prefer an AWS profile name supplied through --profile, or credentials already configured in the process environment.
  • If a file must be supported, parse it as data rather than shell code. Permit only a strict allowlist such as AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_PROFILE, and AWS_REGION.
  • Reject command substitutions, shell metacharacters, functions, redirects, and any unrecognized keys.
  • Read credentials into a dedicated child-process environment instead of modifying the Agent's current shell.
  • Verify file ownership and restrictive permissions before reading it.
  • Never print secret values in command output or generated reports.
  • Require explicit user confirmation after identifying the exact file and before importing any credential material.

T09 · Insecure Skill Coding Practices

Error
Location
references/assessment-workflow.md:22
Finding

Shell Command Injection Through Unquoted Assessment Parameters

Content
View full analysis

Vulnerability Details

File Location: references/assessment-workflow.md:22-64, references/assessment-workflow.md:108-164
Vulnerability Type: Command injection through shell interpolation
Risk Level: High

Representative vulnerable code:

bash
# Replication group overview (topology, Multi-AZ, failover, encryption, auth)
aws elasticache describe-replication-groups \
  --replication-group-id {REPL_GROUP_ID} \
  --region {REGION} --output json

# Node-level details (engine version, node type, AZ, parameter group, subnet group)
aws elasticache describe-cache-clusters \
  --show-cache-node-info \
  --region {REGION} --output json

# Subnet group details (VPC, AZs, custom vs default)
aws elasticache describe-cache-subnet-groups \
  --cache-subnet-group-name {SUBNET_GROUP_NAME} \
  --region {REGION} --output json

# Resource tags
aws elasticache list-tags-for-resource \
  --resource-name {REPL_GROUP_ARN} \
  --region {REGION} --output json
bash
aws rds describe-db-instances --db-instance-identifier {DB_ID} --region {REGION} --output json
aws rds describe-db-clusters --db-cluster-identifier {CLUSTER_ID} --region {REGION} --output json
aws kafka describe-cluster --cluster-arn {CLUSTER_ARN} --region {REGION} --output json
aws dynamodb describe-table --table-name {TABLE_NAME} --region {REGION} --output json
aws eks describe-cluster --name {CLUSTER_NAME} --region {REGION} --output json
aws eks describe-nodegroup --cluster-name {CLUSTER_NAME} --nodegroup-name {NG_NAME} --region {REGION} --output json

Technical Analysis

Resource identifiers, ARNs, profile-related values, parameter-group names, and regions originate from user input or prior command output. The templates place these values directly into shell command text without quoting, validation, or argument-boundary enforcement.

If an Agent implements these instructions by constructing a command string and passing it ...[truncated 1362 chars]

Remediation
View remediation

Remediation Suggestions

  • Execute AWS CLI commands with a subprocess API that accepts an argument array and does not invoke a shell.
  • Treat every resource identifier, ARN, region, profile, and group name as an untrusted value.
  • Validate regions against the AWS region-name format or an authoritative region list.
  • Apply service-specific validation to resource IDs and names, including length and character constraints.
  • Validate ARNs with an ARN parser and verify the expected partition, service, account, region, and resource type.
  • Reject control characters, newlines, null bytes, shell metacharacters, and unexpected whitespace.
  • If commands are displayed for manual execution, shell-escape every value and clearly state that placeholders must not be substituted into raw shell strings.
  • Avoid logging credential-bearing environments or secret values when subprocess execution fails.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/assessment-workflow.md:29
Finding

Account-Wide Resource Enumeration Exceeds Target Assessment Scope

Content
View full analysis

Vulnerability Details

File Location: references/assessment-workflow.md:29-34, references/assessment-workflow.md:60-64, references/assessment-workflow.md:108-116, references/assessment-workflow.md:137-164
Vulnerability Type: Excessive data access and insufficient resource scoping
Risk Level: Medium

Vulnerable code:

bash
# Node-level details (engine version, node type, AZ, parameter group, subnet group)
aws elasticache describe-cache-clusters \
  --show-cache-node-info \
  --region {REGION} --output json
bash
# Check SNS notification subscriptions related to ElastiCache
aws sns list-subscriptions --region {REGION} --output json

# Check if Global Datastore is configured
aws elasticache describe-global-replication-groups --region {REGION} --output json
bash
aws rds describe-db-parameter-groups --region {REGION} --output json
bash
# Check OIDC provider for IRSA support
aws iam list-open-id-connect-providers --region {REGION} --output json

Technical Analysis

The Skill is framed as an assessment of a named AWS resource, but several commands enumerate all matching resources in an account or region. For example, describe-cache-clusters is invoked without a cache-cluster identifier, list-subscriptions lists SNS subscriptions beyond the target service, and list-open-id-connect-providers returns account-wide IAM identity-provider metadata.

These calls do not directly escalate AWS privileges, but they cross a least-privilege data boundary by collecting metadata unrelated to the named target. The collected inventory may enter the Agent context, command logs, or assessment artifacts. The workflow does not require explicit user consent for this broader enumeration or define controls for minimizing and discarding unrelated results.

Attack Path

  1. A user provides AWS credentials to assess one named resource.
  2. The Agent follows the documented w ...[truncated 912 chars]
Remediation
View remediation

Remediation Suggestions

  • Add target-resource identifiers or API filters to every command where AWS supports them.
  • For ElastiCache, derive the relevant cache-cluster IDs from the specified replication group and query only those clusters.
  • Replace account-wide SNS enumeration with a narrowly scoped check based on the target resource's configured notification topic.
  • Query only the parameter group attached to the named RDS resource.
  • For EKS OIDC verification, derive the issuer from the specified cluster and compare only the corresponding provider ARN; avoid retaining unrelated providers.
  • Make optional account-wide checks opt-in and explain exactly which metadata will be collected.
  • Use a documented least-privilege IAM policy tailored to the target service and resource wherever AWS supports resource-level permissions.
  • Filter command responses before they enter the Agent context, and do not include unrelated account inventory in generated reports or logs.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger list contains broad phrases such as 'assessment', '帮我查找', '汇总成表', and '帮我检查', which are common in normal conversations and can cause the skill to activate outside its intended AWS best-practice context. Overbroad activation increases the chance the agent invokes AWS tooling or local command workflows unexpectedly, especially when the skill also supports live assessment and credential handling.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly instructs the agent to run source <credential-file-path> on a user-provided file, which executes arbitrary shell commands in the current shell context rather than merely loading credentials. Because the file path is user-controlled and the skill is meant for AWS assessment, this creates a command-execution path far beyond the stated purpose and can lead to host compromise, secret exfiltration, or persistence.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill tells the agent to source a credential file but provides no warning that this executes local shell code and may expose or misuse secrets. This is especially dangerous in a skill that normalizes accepting credential paths from users, because operators may believe they are supplying data when they are actually authorizing arbitrary command execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The workflow directs the agent to run multiple AWS CLI describe/list commands that return detailed infrastructure metadata, including topology, tags, events, subnet configuration, and security settings, but it does not instruct the agent to warn the user that this data may be sensitive or to minimize, redact, or carefully handle the returned output. In a live assessment context, this can lead to over-collection and unnecessary exposure of operationally sensitive cloud configuration data in chat transcripts, logs, or downstream tooling.

Content

No source excerpt is available for this finding.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

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

md
Items about: encryption at-rest/in-transit, authentication (AUTH/RBAC/IAM), subnet groups, security groups, KMS keys, dangerous command renaming, RBAC metrics monitoring, IAM control plane policies.

**Category 5: Others**
Items not covered by the above 4 categories, including but not limited to: auto minor version upgrade, engine version, node type selection (Graviton), CloudWatch monitoring, reserved memory, connection pooling, read routing, expensive commands, slow log, IaC management, Auto Scaling, cost tags, client retry logic, performance tuning, operational best practices.

#### Scope Boundary for Container / Orchestration Platforms

Static analysis

No suspicious patterns detected.