Back to skill

Security audit

C 盘清理助手

Security checks for vulnerabilities and agentic risk

Overview

This C-drive cleanup skill is mostly transparent, but needs review because its sample WinRM setup disables certificate validation while handling Windows credentials and remote file deletion or migration.

Review before installing. Use a least-privileged WinRM account, prefer environment variables or a secrets manager, change certificate validation to a validating mode with a trusted certificate, and use scan-only mode unless you are ready to explicitly approve each cleanup or migration. Do not use migration if files should not leave the Windows host.

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

Error
Location
config/credentials.example.json:7
Finding

WinRM TLS Certificate Validation Is Disabled by Default

Content
View full analysis

Vulnerability Details

File Location: config/credentials.example.json:7-13
Related Usage: README.md:17-19
Vulnerability Type: Improper TLS certificate validation
Risk Level: High

Vulnerable Code

json
"winrm": {
  "host": "WINRM_HOST",
  "port": 5986,
  "transport": "https",
  "auth": "ntlm",
  "username": "WINDOWS_USER",
  "password": "USE_SECURE_STORAGE_INSTEAD",
  "serverCertValidation": "ignore"
}

The documented setup instructs users to copy this example into the active configuration:

bash
# Or edit config/credentials.json (do not commit it to version control!)
cp config/credentials.example.json config/credentials.json
# Then edit config/credentials.json and enter the actual credentials

Technical Analysis

Although WinRM is configured to use HTTPS, setting serverCertValidation to ignore prevents the client from authenticating the remote server's certificate. Encryption without endpoint authentication does not adequately protect against an active man-in-the-middle attacker.

The documented configuration workflow tells users to copy the example file and replace its credential placeholders. Unless users independently change the certificate-validation option, the resulting operational configuration retains the insecure setting. This also conflicts with the project's general recommendation to use WinRM over HTTPS securely.

An attacker with the ability to intercept, redirect, or spoof network traffic between the Agent server and the Windows host could present an arbitrary certificate without causing validation to fail. The exact ability to capture or relay NTLM authentication depends on the WinRM client and authentication settings, but disabling certificate verification makes endpoint impersonation and traffic manipulation materially easier.

Attack Path

  1. A user copies config/credentials.example.json to config/credentials.json as instructed.
  2. The user supplies a real WinRM host, username, and pas ...[truncated 1326 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace the insecure default with strict certificate validation:
json
"serverCertValidation": "validate"
  1. Configure the Agent server to trust the CA that issued the Windows host's WinRM certificate.
  2. For self-signed certificates, import the expected certificate into a dedicated trust store or implement explicit certificate/thumbprint pinning instead of globally disabling validation.
  3. Fail closed on expired, mismatched, revoked, or untrusted certificates.
  4. Update the setup documentation so copying the example produces a secure configuration without requiring additional undocumented changes.
  5. Add startup validation that rejects serverCertValidation: "ignore" outside an explicitly designated local test environment.
  6. If an exceptional test-only bypass is retained, require an explicit opt-in warning and prohibit its use with production credentials.
  7. Use a dedicated least-privileged WinRM account and restrict network access to the expected Agent server as defense in depth.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (9)

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 · README.md (reported line 23)May include surrounding context.

export WINRM_PASS="YOUR_WINRM_PASSWORD" export MIGRATION_TARGET="/path/to/migration-target/"

或者编辑 config/credentials.json(不要提交到版本控制!)

cp config/credentials.example.json config/credentials.json

然后编辑 config/credentials.json 填入实际凭证

text

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 · README.md (reported line 24)May include surrounding context.

export WINRM_PASS="YOUR_WINRM_PASSWORD" export MIGRATION_TARGET="/path/to/migration-target/"

或者编辑 config/credentials.json(不要提交到版本控制!)

cp config/credentials.example.json config/credentials.json

然后编辑 config/credentials.json 填入实际凭证

text

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 · README.md (reported line 25)May include surrounding context.

export WINRM_PASS="YOUR_WINRM_PASSWORD" export MIGRATION_TARGET="/path/to/migration-target/"

或者编辑 config/credentials.json(不要提交到版本控制!)

cp config/credentials.example.json config/credentials.json

然后编辑 config/credentials.json 填入实际凭证

text

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file consistently instructs users in Chinese and requires Chinese response phrases such as “确认删除” and “取消” for confirmations. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the regional/language limitation is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This JSON file uses Chinese-only natural-language descriptions and notes, including user-facing policy statements such as protected directory explanations. Under the policy rule, forcing a specific language without opt-in or a documented region-specific justification is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest presents the primary user-facing identity and summary in Chinese, with English only in alternate fields. This can be a language/locale policy issue if the skill is surfaced by default to users who have not opted into Chinese, since the file does not state any locale restriction or user language selection behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This JSON example uses user-facing natural-language descriptions and warnings entirely in Chinese, but the file does not indicate that the skill is region-specific or that users can choose another language. That can violate a language/locale policy requiring user choice or documented justification for a forced locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This JSON file contains user-facing natural-language text in Chinese ("C 盘扫描阈值配置") with no indication that the skill is region-specific or that users can choose another language. Per the policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains all user-facing instructions in Chinese, and there is no indication that the skill is intended only for Chinese-speaking users or that language selection is optional. That can violate a language/locale policy when users are not given a choice or opt-in.

Content

No source excerpt is available for this finding.