T09 · Insecure Skill Coding Practices
- Location
scripts/node/lib/ews-client.mjs:20- Finding
Exchange Credentials Can Be Transmitted over Insecure or Unauthenticated Connections
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to do its stated Exchange mailbox and calendar job, but it warrants Review because it handles high-value credentials and mailbox data with unsafe transport and setup options.
Install only if you are comfortable granting the configured Exchange account permission to read, send, modify, and delete mailbox, folder, and calendar data. Use a dedicated least-privilege account, require an https:// Exchange URL, avoid --insecure and EXCHANGE_INSECURE, do not put the password or master key directly on command lines, and review or update the NTLM dependency chain before production use.
scripts/node/lib/ews-client.mjs:20Exchange Credentials Can Be Transmitted over Insecure or Unauthenticated Connections
scripts/node/core/setup-exchange-config.mjs:13Documented Setup Procedure Exposes the Exchange Password and Master Key in Process Arguments
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
---
name: exchangeservice
description: Cross-platform (Linux/macOS/Windows) skill for Exchange Server 2016 CU21 EWS operations on OpenClaw Node.js runtime.
metadata: {"openclaw":{"emoji":"✉️","requires":{"env":["EXCHANGE_URL","EXCHANGE_USERNAME","EXCHANGE_AUTH_MODE","EXCHANGE_PASSWORD","EXCHANGE_SKILL_MASTER_KEY"],"bins":["node","npm"]},"primaryEnv":"EXCHANGE_PASSWORD"}}
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
---
name: exchangeservice
description: Cross-platform (Linux/macOS/Windows) skill for Exchange Server 2016 CU21 EWS operations on OpenClaw Node.js runtime.
metadata: {"openclaw":{"emoji":"✉️","requires":{"env":["EXCHANGE_URL","EXCHANGE_USERNAME","EXCHANGE_AUTH_MODE","EXCHANGE_PASSWORD","EXCHANGE_SKILL_MASTER_KEY"],"bins":["node","npm"]},"primaryEnv":"EXCHANGE_PASSWORD"}}
The lockfile pins underscore to 1.12.1, which the supplied advisory identifies as vulnerable to unlimited recursion in _.flatten and _.isEqual, enabling potential denial of service through stack exhaustion or excessive processing. Although this is a transitive dependency pulled in by httpntlm rather than obviously attacker-chosen code, skills that process untrusted mail/calendar data can still be exposed if vulnerable utility functions are reachable in request or response handling.
The package description at L06 presents the skill generically as an "Exchange on-prem skill runtime," which does not disclose that it performs extensive state-changing operations such as creating meetings, sending mail, creating/updating/deleting folders, moving/copying/deleting items, replying, archiving, and marking mail read. The code-facing entry points in L08-L29 show a much broader and more sensitive operational scope than the description communicates.
This code performs a network request to Exchange containing mailbox selection and calendar query parameters, and receives potentially sensitive calendar contents. The script has no confirmation prompt, user-facing log message, or inline comment/docstring warning that it is contacting a remote server and retrieving calendar data.
This code reads a master key and password from environment variables and then uses them for authentication, which is a sensitive credential-handling operation. The file contains no confirmation prompt, user-facing notice, or explanatory comment/docstring warning that credentials may be sourced from process environment variables.
The script performs a live authentication request using supplied credentials and allows the TLS validation behavior to be weakened through the insecure option. In a login-verification context this is expected functionality, but if insecure is enabled it can expose credentials to man-in-the-middle interception or allow communication with an untrusted endpoint, making the context materially more dangerous.
The code explicitly supports disabling TLS certificate verification by creating an undici Agent with rejectUnauthorized: false and by passing rejectUnauthorized: !insecure into NTLM requests. This enables man-in-the-middle attacks against EWS authentication traffic, which is especially risky here because the module handles Basic and NTLM credentials and SOAP data sent to a mail server.
TLS validation can be disabled without any built-in warning, audit signal, or friction, making it easy for callers to unknowingly send Exchange credentials over a connection vulnerable to interception. In this skill context, the danger is elevated because the client is designed to authenticate to EWS using Basic or NTLM, so successful interception could expose mailbox access or session material.
This code assembles sensitive mailbox data into an output object and writes it directly to stdout. For code files, access to potentially sensitive user data should have some visible disclosure such as a prompt, warning, or explanatory comment/docstring, and none appears in this file.
The script performs multiple EWS network calls (FindFolder, FindItem, GetFolder, GetItem) against a mailbox service, including requests that can retrieve message content and recipient data. In this file, there is no visible warning, prompt, or explanatory comment informing the user that mailbox data will be sent to and retrieved from a remote Exchange service.
The script can retrieve message bodies and recipient lists via GetItem when includeBody/includeRecipients are enabled, then prints the resulting mailbox contents as JSON. There is no confirmation prompt, visible warning, or explanatory comment/docstring in this file to disclose that sensitive email content and addressing metadata may be accessed and output.
The dependency uses a caret range (^1.8.13), allowing future 1.x releases of httpntlm to be installed implicitly. In a security-sensitive skill that authenticates to on-prem Exchange via NTLM, drifting to an unreviewed dependency version increases supply-chain risk and can introduce vulnerable or malicious code into authentication flows.
"mark-all-read": "node ./scripts/node/mailbox-items/mark-all-read.mjs"
},
"dependencies": {
"httpntlm": "^1.8.13"
}
}
The script reads mailbox selection from EXCHANGE_MAILBOX and then sends a GetFolder request to Exchange, which is a network operation involving user or system mailbox data. Within this file there is no confirmation prompt, comment, or user-facing notice describing that mailbox context may be taken from environment variables and transmitted to the Exchange service.
The saveConfig function creates directories and writes a configuration file to disk, which is a safety-relevant file modification. In this file there is no confirmation prompt, user-facing log/print, or explanatory comment/docstring disclosing that the function will persist configuration data.
The readPassword function accesses sensitive authentication material by returning either a provided password, a decrypted secret_store value, or a plaintext password from config. This file contains no user-facing warning, log, or explanatory comment/docstring indicating that credential material will be read and decrypted.
The normalization logic explicitly bakes in specific language conventions for reply prefixes (答复, 回复, 转发) in addition to English ones. This imposes language-specific behavior without any user opt-in or documented locale rationale, which can be a natural-language locale policy concern.
The function performs an EWS FindItem request against the user's sent-items folder, which accesses mailbox metadata and transmits request data over the network. In this file there is no confirmation prompt, logging, or comment/docstring disclosing that mailbox contents will be queried.
No suspicious patterns detected.