CVE-2021-25864: Path Traversal in node-red-contrib-huemagic

node-red-contrib-huemagic Updated 02 Oct 2025

Summary

13/04/2021
No i
High
7.5

CVE-2021-25864: Path Traversal in node-red-contrib-huemagic. Affects node-red-contrib-huemagic versions < 3.0.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

node-red-contrib-huemagic is an npm package that provides functionality for controlling Philips Hue lights in Node-RED. It allows users to integrate their Hue lights into their Node-RED flows and automate various lighting tasks. However, version 3.0.0 of this package is affected by a path traversal vulnerability. This vulnerability exists in the res.sendFile API used in the file hue-magic.js, which can be exploited to fetch arbitrary files by manipulating the 'hue/assets/..%2F' path.

Vulnerability Detail

The path traversal vulnerability in node-red-contrib-huemagic version 3.0.0 allows an attacker to access files outside of the intended directory. By manipulating the 'hue/assets/..%2F' path, an attacker can traverse the file system and retrieve sensitive files. This could lead to unauthorized access to sensitive information or the execution of malicious code. The vulnerability has a CVSS score of 7.5, indicating a high severity level.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, you can manually modify the affected file, hue-magic.js, to implement proper input validation and sanitization. Here is an example of how to mitigate the vulnerability by adding input validation to the res.sendFile API:

// Add input validation to prevent path traversal
function sendFileWithValidation(res, filePath) {
  const safeFilePath = validateFilePath(filePath);
  res.sendFile(safeFilePath);
}

// Validate file path to prevent path traversal
function validateFilePath(filePath) {
  // Implement your validation logic here
  // Ensure the filePath is within the intended directory
  // Reject any filePath that contains '..' or '%2F'
  // Return the safe filePath
}

Conclusion

In conclusion, node-red-contrib-huemagic version 3.0.0 is affected by a path traversal vulnerability that can be exploited to access arbitrary files outside of the intended directory. It is recommended to upgrade to a non-vulnerable version of the package or apply the provided workaround. For further assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for node-red-contrib-huemagic →

Share this vulnerability

FAQ

node-red-contrib-huemagic is an npm package that provides functionality for controlling Philips Hue lights in Node-RED.

This vulnerability allows an attacker to access arbitrary files outside of the intended directory, potentially leading to unauthorized access to sensitive information or the execution of malicious code.

To fix this vulnerability, it is recommended to upgrade to a version of node-red-contrib-huemagic that is not affected by this issue. Any version after 3.0.0 should be safe to use.

Yes, as a temporary workaround, you can manually modify the affected file, hue-magic.js, to implement proper input validation and sanitization. See the 'workaround' section for an example.

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback