CVE-2026-71279: Zigbee2MQTT External JS Extension Path Traversal Leading to Remote Code Execution

Published Aug 5, 2026
·
Updated

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 enableexternaljs 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.

Affected Software

1 affected component
Zigbee2MQTT

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Ensure the Zigbee2MQTT configuration option enable_external_js is disabled, since the External JS extension handler writes and dynamically imports unsanitized filenames received via MQTT.

    Zigbee2MQTT External JS Extension enable_external_js = off (default)
  2. Configuration

    Patch Zigbee2MQTT ExternalJSExtension.getFilePath() to sanitize/validate the MQTT-provided name before using path.join(basePath, name), preventing traversal such as ../../tmp/evil.js that escapes the intended extensions directory.

    Zigbee2MQTT ExternalJSExtension.getFilePath() (lib/extension/externalJS.ts) filename/path sanitization = validate & prevent path traversal (e.g., reject names containing ../ or leading /)
  3. Configuration

    Update the extension-removal handler that uses the identical unsanitized getFilePath() so it also rejects path traversal filenames, preventing arbitrary file deletion.

    Zigbee2MQTT extension-removal handler same getFilePath() usage = sanitize/validate path traversal in removal path too
  4. Compensating control

    Restrict access to the MQTT broker and specifically the topic zigbee2mqtt/bridge/request/extension/save to authenticated/authorized clients only, since the extension name is received via MQTT and commonly is unauthenticated in real deployments.

Event History

Aug 5, 2026
CVE Published
via MITRE·12:26 PM
Data Sourced
via MITRE·12:26 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:24 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-71279?

The severity of CVE-2026-71279 is rated high with a score of 8.1.

2

How do I fix CVE-2026-71279?

To fix CVE-2026-71279, ensure to sanitize the 'name' parameter before it is used in the path.join() function.

3

What type of vulnerability is CVE-2026-71279?

CVE-2026-71279 is a Path Traversal vulnerability that can lead to remote code execution.

4

What software is affected by CVE-2026-71279?

The vulnerability affects Zigbee2MQTT, specifically in the ExternalJSExtension component.

5

What attack vector does CVE-2026-71279 use?

CVE-2026-71279 uses the MQTT messaging protocol to exploit an insecure method of handling file paths.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203