CVE-2025-64756
glob: glob: Command Injection Vulnerability via Malicious Filenames
Severity
ImportantRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · November 18, 2025
Updated · November 1, 2026
Description
A flaw was found in glob. This vulnerability allows arbitrary command execution via processing files with malicious names when the glob command-line interface (CLI) is used with the -c/--cmd option, enabling shell metacharacters to trigger command injection.
Statement
This flaw in glob allows arbitrary command execution when the glob command-line interface is used with the -c/--cmd option to process files with malicious names. The vulnerability is triggered by shell metacharacters in filenames, leading to command injection. The glob CLI tool utilizes the -c option to execute shell commands over the files which matched the searched pattern by using the shell:true parameter when creating the subprocess which will further execute the command informed via '-c' option, this parameter allows the shell meta characters to be used and processed when executing the command. Given that information glob misses to sanitize the file name to eliminate such characters and expressions from the filename, leading to code execution as when performing the shell expansion such characters will be interpreted as shell commands.
To exploit this vulnerability the targeted system should run the glob CLI over a file with a maliciously crafted filename, additionally the attacker needs to have enough permission to create such file or trick the user to download and process the required file with the glob CLI.
This flaw is present in the command line interface of the nodejs-glob package. When the package is used by npm, the command line interface is not used at all, so it cannot be triggered. However, the command line interface implementation is still present on the system, but not directly exposed to the user's $PATH. To reflect this condition, nodejs packages have been rated with a low severity.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
To mitigate this issue, avoid using the glob command-line interface with the -c or --cmd option when processing filenames from untrusted sources. If programmatic use of glob is necessary, ensure that filenames are thoroughly sanitized before being passed to commands executed with shell interpretation enabled.
CVSS / CWE
CVSS 3.1 · 7.5CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
CWE-78 · Improper Neutralization of Special Elements used in an OS Command