Back to skill

Security audit

icosmos shop

Security checks for vulnerabilities and agentic risk

Overview

This Shopify operations skill is mostly coherent, but it asks users to store account credentials and cache Shopify tokens without enough detail about protection, scope, or the missing CLI implementation.

Review this carefully before installing. Use only with stores and credentials you are authorized to access, prefer least-privilege Shopify scopes, avoid long-lived password environment variables if possible, and require clear documentation for the token cache location, permissions, expiration, deletion, and the provenance of the icosmos-shopify executable.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:15
Finding

Insecure Handling of Account Credentials and Shopify Access Tokens

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 15 and 47-54
Vulnerability Type: Credentials retained in environment variables and access tokens stored in an unspecified local cache
Risk Level: Medium

Evidence

text
1. `setup once`: Use `ICOSMOS_USER_EMAIL` / `ICOSMOS_USER_PASSWORD` to synchronize stores and tokens to a local cache.
text
- Setup Once:

  - `ICOSMOS_USER_EMAIL`
  - `ICOSMOS_USER_PASSWORD`

  Both fields must be saved as system environment variables.

  The required command-line tool is `icosmos-shopify` in the current directory.

The excerpts above are faithful English renderings of the corresponding instructions in SKILL.md.

Technical Analysis

The skill directs users to retain an account email and password in system environment variables and to synchronize Shopify access tokens into a local cache. It does not specify the cache location, encryption controls, owner-only file permissions, credential lifetime, deletion procedure, or access restrictions.

Environment variables can be inherited by child processes and may be exposed through diagnostic output, crash reports, process inspection mechanisms, or incorrectly configured execution environments. A local token cache without explicitly enforced permissions or encryption may be readable by other processes or local users.

The referenced icosmos-shopify executable is not included in the audited project. Consequently, the audit could not verify its authentication destination, cache implementation, file permissions, token encryption, redaction behavior, or deletion controls. The documentation later claims token redaction and suppression of sensitive order fields, but no implementation is present to substantiate those safeguards.

Attack Path

  1. A user configures ICOSMOS_USER_EMAIL and ICOSMOS_USER_PASSWORD as persistent system environment variables.
  2. The skill invokes `icosmos-shopify setup once ...[truncated 1326 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace persistent password environment variables with a short-lived authentication flow, delegated authorization, or narrowly scoped service token.
  2. Store secrets in an operating-system credential manager or dedicated secret-management service rather than in general process environments.
  3. If local caching is necessary, encrypt tokens at rest and create cache files with owner-only permissions, such as mode 0600 on Unix-like systems.
  4. Document the exact cache location, retention period, expiration behavior, rotation process, and secure deletion command.
  5. Prevent credentials and tokens from appearing in command-line arguments, logs, exceptions, telemetry, shell history, or diagnostic output.
  6. Apply least-privilege Shopify scopes and use separate read-only credentials for diagnostics. Obtain a distinct, explicitly authorized credential only when a write operation is required.
  7. Document and authenticate the remote service endpoint to which account credentials are submitted.
  8. Include the command-line implementation in the package for review, or distribute it as a version-pinned, signed artifact with published checksums and reproducible provenance.
  9. Add automated tests verifying token redaction, sensitive-field suppression, restrictive cache permissions, credential expiration, and cleanup behavior.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## 常见问题与排障

- **401/403**:Admin token scopes 不足或 token 过期;确认 Shopify Custom App 的 Admin API access token 与权限。
- **429 Too Many Requests**:已做退避重试;如果频繁触发,降低并发/减少拉取字段/缩小时间范围。
- **Storefront 430 Security Rejection**:请求可能被判定为异常;需要检查请求来源、token 是否正确,必要时增加更真实的请求头策略(后续增强)。

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The activation description lists high-level phrases like '店铺审计', '产品优化', '转化下降', and '营销效果差' without clear boundaries or exclusion conditions. These are common business-support topics and could cause unintended invocation because the file does not define a narrow trigger scope or negative examples.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language policy requires avoiding forced language or locale unless the user is given a choice or the restriction is justified. This file presents the skill description, trigger guidance, and usage entirely in Chinese, with no opt-in or explanation that the skill is intended only for Chinese-speaking users or a China-specific workflow.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.