Back to skill

Security audit

帮助小白记录环境变量,如电脑遇到不可知问题,可以优先访问log排查问题

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly coherent, but it tells the agent to log old and new environment-variable values in plaintext, which can expose secrets.

Review this skill before installing if you work with API keys, passwords, cloud credentials, database URLs, or private logs. It should only be used with clear user direction, and environment-variable logs should redact secret values or record only variable names, timestamps, reasons, and success status.

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:34
Finding

Plaintext Logging of Potentially Sensitive Environment Variable Values

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 34–46
Vulnerability Type: Plaintext storage of potentially sensitive data
Risk Level: Medium

Vulnerable Code Snippet:

markdown
## 记录要求

默认把环境变量变更记录写到:

- `logs/env-change-log.md`

每次记录至少包含:

- 时间
- 改了哪个变量
- 修改前是什么
- 修改后是什么
- 为什么要改

Technical Analysis

The Skill requires every environment-variable change record to contain both the previous and new values. It does not exclude secret-bearing variables or require sensitive values to be detected and redacted.

Environment variables commonly store API keys, access tokens, passwords, private connection strings, and other credentials. Following these instructions when modifying such a variable would place both the old and replacement secrets in plaintext in the predictable project-local file logs/env-change-log.md. This also preserves credentials after the original environment variable has been changed or rotated.

No automatic code execution or privilege escalation is involved. Exploitation requires the Skill to process a sensitive variable and an unauthorized party subsequently to gain access to the generated log through the workspace, source control, backups, shared artifacts, or another local access path.

Attack Path

  1. A user asks an agent using this Skill to change an environment variable containing a credential.
  2. The agent follows the mandatory logging instructions.
  3. The agent writes the variable's old and new plaintext values to logs/env-change-log.md.
  4. The log is committed to source control, included in a backup or artifact, shared with another party, or read by another user or agent with workspace access.
  5. The unauthorized party extracts the credential and uses it against the service or resource to which that credential grants access.

Impact Assessment

Disclosure is limited to values recorded in the log, but those values may grant access to externa ...[truncated 535 chars]

Remediation
View remediation

Remediation Suggestions

  1. Prohibit logging the values of secret-bearing environment variables. Record only the timestamp, variable name, reason, operation type, and whether the change succeeded.
  2. Detect sensitive names such as TOKEN, SECRET, PASSWORD, PASS, API_KEY, PRIVATE_KEY, and credential-bearing connection variables. Treat uncertain values as sensitive by default.
  3. If change correlation is necessary, store a non-reversible fingerprint or a heavily redacted representation, such as sha256:…9f2a or sk-…9f2a, rather than the original value.
  4. Require explicit user consent before logging any non-secret value.
  5. Add logs/env-change-log.md to .gitignore and equivalent artifact-exclusion rules.
  6. Create the log with restrictive file permissions and document retention and secure-deletion requirements.
  7. Add a mandatory pre-write check that aborts or redacts the record whenever the value resembles a credential, token, private key, password, or authenticated connection string.
Vulnerability Patterns
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README states in Chinese that this is a skill better suited for beginners, and multiple later lines require explanations '用电脑小白能听懂的话解释', but the document does not offer any language or locale choice. Because the skill description is written entirely in Chinese and frames the output style in Chinese-only terms, it implies a fixed language behavior without user opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes very broad phrases like '看看是什么问题', '帮我查下日志', and '我看不懂这个错误', which could cause this skill to activate in many generic troubleshooting conversations beyond environment-variable changes. Because the skill directs the agent to inspect logs and environment state, unintended invocation may expose sensitive diagnostic data or steer the session into making system changes when the user did not explicitly request this specialized workflow.

Content

No source excerpt is available for this finding.