Back to skill

Security audit

Ews Email

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims for Exchange email, but its attachment download code can write outside the chosen folder and its headless Linux credential guidance weakens protection of mailbox credentials.

Install only if you trust this skill with full access to the configured Exchange mailbox and are comfortable reviewing its code. Avoid using attachment-download until filenames are sanitized and existing files are protected from overwrite. On headless Linux, do not store KEYRING_CRYPTFILE_PASSWORD in broadly readable config, shell profiles, logs, or service files; prefer a platform secret manager or tightly scoped secret injection.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ews-mail.py:299
Finding

Path Traversal and Arbitrary File Overwrite Through Attachment Filenames

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:9
Finding

Security-Sensitive Dependencies Are Not Version or Hash Pinned

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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 (40)

Credential Access

High
Category
Privilege Escalation
Confidence
72% confidence
Finding

The Linux setup recommends keyrings.alt EncryptedKeyring with file-based encrypted secret storage on headless systems. While not inherently malicious, this backend is weaker operationally than a native secure secret store and can expand the attack surface if the host, file permissions, or master-password handling are weak.

Content

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

bash
# 安装依赖
pip3 install keyring exchangelib keyrings.alt

# 设置 master password 环境变量(用于加解密 EWS 密码)
# 在 ~/.openclaw/config.yaml 中添加:

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

The instructions recommend placing KEYRING_CRYPTFILE_PASSWORD in persistent configuration as an environment variable. Storing a master decryption password in config or process environment materially weakens the protection of the encrypted keyring because other local processes, service configs, crash dumps, or misconfigured logs may expose it.

Content

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

md
# 设置 master password 环境变量(用于加解密 EWS 密码)
# 在 ~/.openclaw/config.yaml 中添加:
#   env:
#     KEYRING_CRYPTFILE_PASSWORD: "你自己定义的一个强密码"
#
# 或在 systemd service / 启动脚本中 export:
export KEYRING_CRYPTFILE_PASSWORD="你自己定义的一个强密码"

Credential Access

High
Category
Privilege Escalation
Confidence
85% confidence
Finding

The guidance to export KEYRING_CRYPTFILE_PASSWORD in startup scripts or service environments encourages persistent plaintext secret exposure at the process/runtime layer. In enterprise or multi-user systems, such environment-based secret handling can be recovered through configuration disclosure, process inspection, support artifacts, or operational mistakes, enabling decryption of stored EWS credentials.

Content

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

md
#     KEYRING_CRYPTFILE_PASSWORD: "你自己定义的一个强密码"
#
# 或在 systemd service / 启动脚本中 export:
export KEYRING_CRYPTFILE_PASSWORD="你自己定义的一个强密码"

# 存储 EWS 密码(会用 AES 加密写入本地文件)
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py setup

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
88% confidence
Finding

The anti-refusal language instructs the agent to never say it cannot read email content and insists on using message-read. Even though framed as operational guidance, this kind of coercive instruction can pressure an agent to bypass caution or contextual safety checks when handling sensitive mailbox data.

Content

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

md
**`envelope-list` only shows subject lines and metadata. It does NOT contain the email body.**
**You MUST run `message-read` to get the actual email content. NEVER guess or summarize based on subject alone.**
**NEVER say you cannot read email content — you CAN, by running `message-read`.**

## Script Location

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 · scripts/ews-mail.py (reported line 11)May include surrounding context.

python
import urllib3
urllib3.disable_warnings()

KEYRING_SERVICE = "openclaw-ews-email"

SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

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 · scripts/ews-mail.py (reported line 18)May include surrounding context.

python
import urllib3
urllib3.disable_warnings()

KEYRING_SERVICE = "openclaw-ews-email"

SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

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 · scripts/ews-mail.py (reported line 31)May include surrounding context.

python
import urllib3
urllib3.disable_warnings()

KEYRING_SERVICE = "openclaw-ews-email"

SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

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 · scripts/ews-mail.py (reported line 33)May include surrounding context.

python
import urllib3
urllib3.disable_warnings()

KEYRING_SERVICE = "openclaw-ews-email"

SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

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 · scripts/ews-mail.py (reported line 52)May include surrounding context.

python
import urllib3
urllib3.disable_warnings()

KEYRING_SERVICE = "openclaw-ews-email"

SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

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 · scripts/ews-mail.py (reported line 133)May include surrounding context.

python
import urllib3
urllib3.disable_warnings()

KEYRING_SERVICE = "openclaw-ews-email"

SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

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 · scripts/ews-mail.py (reported line 134)May include surrounding context.

python
import urllib3
urllib3.disable_warnings()

KEYRING_SERVICE = "openclaw-ews-email"

SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

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 36)May include surrounding context.

md
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 16)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 17)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 19)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 23)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 27)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 29)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 37)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 38)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 39)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 42)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 44)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 46)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

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 · scripts/ews-mail.py (reported line 54)May include surrounding context.

python
SERVER = os.environ.get("EWS_SERVER", "")
EMAIL = os.environ.get("EWS_EMAIL", "")

def _init_keyring():
    """Initialize keyring backend. On headless Linux, use EncryptedKeyring with
    master password from KEYRING_CRYPTFILE_PASSWORD env var."""
    import keyring

Static analysis

No suspicious patterns detected.