T09 · Insecure Skill Coding Practices
- Location
scripts/mqtt-client.js:239- Finding
TLS Certificate Verification Is Disabled by Default
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This MQTT automation skill is mostly coherent, but it needs review because it can handle credentials and persistent configuration in ways that may silently weaken or redirect secure connections.
Review before installing. Use only least-privilege MQTT accounts, avoid the `#` wildcard except on trusted scoped brokers, do not run it from untrusted project directories, secure `~/.openclaw/openclaw.json` permissions, and prefer a pinned dependency plus a fix for TLS certificate verification before using it with real credentials.
scripts/mqtt-client.js:239TLS Certificate Verification Is Disabled by Default
scripts/mqtt-client.js:135Untrusted Working-Directory Configuration Can Redirect MQTT Credentials
SKILL.md:18Runtime Dependency Is Installed Without Version or Integrity Pinning
scripts/mqtt-client.js:1248Module Import Mutates User Configuration and May Create a Plaintext Credential File with Permissive Permissions
Referenced artifact was not completely inspected
const { MqttClient } = require('./scripts/mqtt-client.js');
Referenced artifact was not completely inspected
const { MqttClient } = require('./scripts/mqtt-client.js');
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
// Last message const last = client.getLastMessage('home/sensors/#');
// Clear history client.clearHistory();
The documented default subscription topic of # subscribes to all topics on the broker, which can expose the client to far more data and trigger activity than intended. In an automation skill, this broad scope increases the chance of unintended message processing, trigger activation, privacy exposure, and operational side effects if the client is connected to a shared or production broker.
The README documents a broad default subscription topic and states that configuration is auto-written to ~/.openclaw/openclaw.json, but it does not clearly warn users about the resulting data access and local persistence implications. In this skill context, users may unknowingly grant the client visibility into all broker messages and persist sensitive connection details or behavior-affecting configuration without understanding the security impact.
Without declared permissions the skill's intent is opaque and cannot be validated.
The skill defaults MQTT_SUBSCRIBE_TOPIC to #, which subscribes to all broker topics, but the documentation does not clearly warn that this can expose sensitive messages, device states, credentials accidentally published to MQTT, or cross-tenant/internal automation data. In an MQTT integration skill, this context makes the omission more dangerous because broad topic capture is a primary data-ingestion path and can unintentionally create large-scale privacy and security exposure.
This MQTT client module includes side effects unrelated to its core purpose: importing the library can create or modify the user's OpenClaw configuration file. Hidden filesystem mutation during import violates least surprise and can be abused in automation contexts to persist configuration changes or alter later tool behavior without explicit operator consent.
Automatically writing ~/.openclaw/openclaw.json from a generic client library is unsafe because consumers may import the module only to access MQTT functionality, not to change host configuration. This creates an unexpected persistence mechanism and can overwrite trust assumptions about local configuration state, especially in shared or agent-managed environments.
Writing a configuration file into the home directory without prior disclosure or confirmation introduces unauthorized persistent state changes. Even though the written values are template defaults, the act itself can interfere with existing workflows, create misleading trusted configuration, or be leveraged by higher-level automation that assumes user-approved config files.
Executing auto-setup on import means merely requiring the module can trigger configuration file creation in the user's home directory without a clear warning. In agent or plugin ecosystems, such non-transparent side effects are dangerous because they can change persistent state during analysis, testing, or dependency loading.
The documentation says the auto-setup function 'creates or extends' the mqtt-client config and is 'automatically called when importing the module.' In practice, when an entry already exists but is missing fields, the function mutates the in-memory object yet only writes to disk if the config is new or forceSetup is true, so the documented 'extends' behavior does not reliably occur persistently.