T09 · Insecure Skill Coding Practices
- Location
scripts/exchange_mail.py:41- Finding
Optional TLS Certificate Verification Bypass Exposes Exchange Credentials and Mailbox Data
- Content
View full analysis
Vulnerability Details
File Location:
scripts/exchange_mail.py:41-45andscripts/exchange_mail.py:82-86; documented inSKILL.md:116
Vulnerability Type: TLS certificate validation bypass
Risk Level: HighVulnerable code:
python # SSL verification is enabled by default for security # If you need to disable SSL verification for corporate certificates, # set EXCHANGE_DISABLE_SSL_VERIFY=1 environment variable if os.environ.get('EXCHANGE_DISABLE_SSL_VERIFY') == '1': import urllib3 urllib3.disable_warnings()python # SSL verification is enabled by default for security # Only disable if explicitly requested via environment variable if os.environ.get('EXCHANGE_DISABLE_SSL_VERIFY') == '1': BaseProtocol.HTTP_ADAPTER_CLS = NoVerifyHTTPAdapterThe insecure option is also explicitly documented:
bash export EXCHANGE_DISABLE_SSL_VERIFY=1 # Only if you need to disable SSL verification (not recommended)Technical Analysis
When
EXCHANGE_DISABLE_SSL_VERIFYequals1, the script replaces the HTTP adapter used byexchangelibwithNoVerifyHTTPAdapter. It also suppresses warnings that would otherwise alert the user to insecure TLS connections.TLS encryption without certificate validation does not authenticate the Exchange server. An attacker capable of intercepting or redirecting network traffic can present an arbitrary certificate and impersonate the configured server. Because the script authenticates using an Exchange username and password and processes sensitive mailbox content, successful interception could expose credentials, messages, contacts, tasks, notes, calendar data, and mailbox mutations.
Attack Path
- The user enables the documented
EXCHANGE_DISABLE_SSL_VERIFY=1setting, commonly to work around an internal or self-signed certificate. - An attacker gains a network interception position or manipulates DNS, routing, or proxy configur ...[truncated 822 chars]
- The user enables the documented
- Remediation
View remediation
Remediation Suggestions
- Remove the certificate-verification bypass and always use a validating TLS adapter.
- Support a configurable corporate certificate authority bundle instead of disabling validation.
- Allow users to provide a CA file through a setting such as
EXCHANGE_CA_BUNDLE, and validate both the certificate chain and server hostname. - Consider certificate or public-key pinning for high-security deployments.
- If an insecure diagnostic mode must remain, prevent it from using production credentials, require an explicit command-line confirmation, and emit a prominent warning on every request.
- Do not suppress TLS warnings globally.
- Update
SKILL.mdto document installation of the corporate CA certificate rather than recommending certificate validation bypass.
