CVE-2026-71279: CWE-22 in Koenkk zigbee2mqtt
Zigbee2MQTT's ExternalJSExtension.getFilePath() (lib/extension/externalJS.ts) joins a `name` parameter received via an MQTT message (topic zigbee2mqtt/bridge/request/extension/save) into the extensions base path using path.join(basePath, name) with no sanitization. Because path.join() resolves `../` sequences, a name such as `../../tmp/evil.js` escapes the intended extensions directory. The extension handler only validates that the name ends in .js/.mjs/.cjs, writes the file, and then dynamically imports it via Node.js import(), achieving remote code execution. Requires the `enable_external_js` config option (off by default, but commonly enabled in legacy installs) and MQTT broker access, which is frequently unauthenticated in real deployments. The identical unsanitized getFilePath() is also used by the extension-removal handler, enabling arbitrary file deletion.
AI Analysis
Technical Summary
The vulnerability in Zigbee2MQTT's ExternalJSExtension.getFilePath() function arises from unsanitized use of a 'name' parameter received via MQTT messages. The function uses path.join(basePath, name) without sanitization, allowing path traversal sequences like '../' to escape the intended directory. The extension handler only checks that the filename ends with .js/.mjs/.cjs, then writes and dynamically imports the file using Node.js import(), enabling remote code execution. Additionally, the same unsanitized path handling is used in the extension removal handler, permitting arbitrary file deletion. Exploitation requires the 'enable_external_js' config option to be enabled and MQTT broker access, which is often unauthenticated in real deployments.
Potential Impact
Successful exploitation allows an attacker with MQTT broker access and the 'enable_external_js' option enabled to execute arbitrary code remotely on the host running Zigbee2MQTT. It also permits arbitrary file deletion via the extension removal handler. This can lead to full compromise of the affected system, including confidentiality, integrity, and availability impacts.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, disabling the 'enable_external_js' configuration option will prevent exploitation. Additionally, securing MQTT broker access with authentication and network controls can reduce exposure. Avoid enabling external JS extensions unless necessary.
CVE-2026-71279: CWE-22 in Koenkk zigbee2mqtt
Description
Zigbee2MQTT's ExternalJSExtension.getFilePath() (lib/extension/externalJS.ts) joins a `name` parameter received via an MQTT message (topic zigbee2mqtt/bridge/request/extension/save) into the extensions base path using path.join(basePath, name) with no sanitization. Because path.join() resolves `../` sequences, a name such as `../../tmp/evil.js` escapes the intended extensions directory. The extension handler only validates that the name ends in .js/.mjs/.cjs, writes the file, and then dynamically imports it via Node.js import(), achieving remote code execution. Requires the `enable_external_js` config option (off by default, but commonly enabled in legacy installs) and MQTT broker access, which is frequently unauthenticated in real deployments. The identical unsanitized getFilePath() is also used by the extension-removal handler, enabling arbitrary file deletion.
CVSS v3.1
Score 8.1high
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Zigbee2MQTT's ExternalJSExtension.getFilePath() function arises from unsanitized use of a 'name' parameter received via MQTT messages. The function uses path.join(basePath, name) without sanitization, allowing path traversal sequences like '../' to escape the intended directory. The extension handler only checks that the filename ends with .js/.mjs/.cjs, then writes and dynamically imports the file using Node.js import(), enabling remote code execution. Additionally, the same unsanitized path handling is used in the extension removal handler, permitting arbitrary file deletion. Exploitation requires the 'enable_external_js' config option to be enabled and MQTT broker access, which is often unauthenticated in real deployments.
Potential Impact
Successful exploitation allows an attacker with MQTT broker access and the 'enable_external_js' option enabled to execute arbitrary code remotely on the host running Zigbee2MQTT. It also permits arbitrary file deletion via the extension removal handler. This can lead to full compromise of the affected system, including confidentiality, integrity, and availability impacts.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, disabling the 'enable_external_js' configuration option will prevent exploitation. Additionally, securing MQTT broker access with authentication and network controls can reduce exposure. Avoid enabling external JS extensions unless necessary.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- TuranSec
- Date Reserved
- 2026-08-05T12:23:34.967Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a7336e5bf8831d539ed9267
Added to database: 08/05/2026, 13:13:09 UTC
Last enriched: 08/05/2026, 13:29:28 UTC
Last updated: 08/06/2026, 00:30:14 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.