Back to skill

Security audit

WeCom邮箱

Security checks for vulnerabilities and agentic risk

Overview

This email skill is mostly purpose-aligned, but it documents raw credential decoding and references personal mailbox secrets, which should be reviewed before use.

Install only if you are comfortable with this skill accessing a dedicated mail-sending credential and potentially sending workspace document content by email. Prefer a narrowly scoped service account, do not store credentials with Base64, remove personal mailbox credential references, and require explicit confirmation of recipient, subject, and exact content before any send.

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

SMTP Credentials May Be Stored Using Reversible Base64 Encoding

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 93–102
Vulnerability Type: Insecure credential storage
Risk Level: Medium

Vulnerable Configuration

The following excerpt is translated into English from the reviewed documentation:

markdown
## Credential Management

- Credential location: ~/.openclaw/workspace/memory/sc-email-credentials.enc
- Encoding method: Base64 or AES encryption
- Decoding command example: `base64 -d ~/.openclaw/workspace/memory/sc-email-credentials.enc`

## Related Files

- Email list: ~/.openclaw/workspace/memory/enmo-emails.enc
- Personal email: ~/.openclaw/workspace/memory/email-credentials.enc

Technical Analysis

Base64 is a reversible encoding scheme and provides no confidentiality, integrity protection, access control, or resistance to credential recovery. An .enc file extension does not make encoded content encrypted. The documented command directly recovers the original content without requiring a cryptographic key.

The documentation also discloses predictable paths for dedicated and personal mailbox credential files. If SMTP credentials are stored at these locations using Base64, any local user, process, plugin, or Agent with workspace read access can recover them immediately.

Although AES can provide confidentiality when implemented correctly, the document does not define an authenticated encryption mode, key storage mechanism, file permissions, key rotation policy, or secret-access boundary. The explicit acceptance of either Base64 or AES therefore permits an insecure deployment.

Attack Path

  1. An attacker obtains read access to the Agent workspace through another compromised Skill, an overly permissive file mode, a shared account, or local process access.
  2. The attacker uses the predictable paths documented in SKILL.md to locate the SMTP credential files.
  3. The attacker executes:
    bash
    base64 -d ~/.openclaw/workspace/mem
    

...[truncated 1321 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove Base64 as an accepted credential-storage method. Clearly state that encoding is not encryption.
  2. Store SMTP credentials in an operating-system keychain, managed secret store, or dedicated credential service rather than Agent memory files.
  3. If file-based storage is unavoidable, use authenticated encryption such as AES-GCM with a randomly generated nonce and a key stored separately in a protected key-management system.
  4. Restrict secret-file permissions to the minimum required account, such as mode 0600 on Unix-like systems, and restrict parent-directory access.
  5. Do not expose personal mailbox credential paths to Skills intended to use only a dedicated mailbox.
  6. Retrieve credentials only when an explicitly authorized email operation is performed, and avoid placing decrypted credentials in logs, prompts, command-line arguments, or persistent Agent memory.
  7. Use provider-issued application passwords or narrowly scoped tokens instead of primary mailbox passwords where supported.
  8. Rotate any credentials that may already have been stored using Base64 and review SMTP logs for unauthorized access.
  9. Define key rotation, credential revocation, secret-access auditing, and failure-handling procedures.
  10. Update the documentation so the .enc suffix is used only for genuinely encrypted and integrity-protected data.
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 (4)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description emphasizes reading meeting minutes and business documents as email content but does not clearly warn that this transmits potentially sensitive internal data outside the local environment. In a skill designed to access documents and send mail, the missing warning makes unsafe data-sharing more likely, especially for users who may not realize the privacy and confidentiality implications.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill documents how to decode an encrypted credential file using Base64, and frames credential access as part of normal operation. That goes beyond the stated purpose of sending email and materially lowers the barrier for an agent or user to expose stored secrets, which could lead to credential theft and unauthorized mailbox or account access.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill references additional credential files, including a personal mailbox credential store, beyond the dedicated sending account. This expands the reachable secret surface and may prompt an agent to access unrelated or higher-sensitivity mail accounts, enabling privilege escalation and unauthorized data access.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad enough to activate on common user requests like 'send email' or 'notify by email' without clearly signaling that files or document contents may be read and transmitted. In this context, over-broad activation increases the chance of unintended skill invocation and accidental exfiltration of workspace content through email.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.