CVE-2026-119672 in Database Toolsinfo

Summary

by MITRE • 11/03/2026

MongoDB Database Tools mongofiles uses a database-stored GridFS filename as the output destination for get_id when --local is not specified. A user who can modify the file metadata can set the stored filename to '-', causing a later authorized retrieval to write the file contents to standard output instead of a local file. If standard output is captured in a location accessible to that user, this may disclose GridFS content the user cannot read directly. Exploitation requires a higher-privileged operator to retrieve the affected file without an explicit local destination and attacker access to the captured output. This issue affects MongoDB Database Tools from version 3.1.4 through versions before 100.20.1.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/03/2026

The vulnerability identified in MongoDB Database Tools, specifically within the mongofiles utility, represents a significant security flaw related to improper handling of file metadata during GridFS operations. This issue arises from how the tool processes filenames stored directly within the database when performing retrieval tasks via the get_id command. Under normal operational conditions, users specify an explicit local destination for the output file using the --local flag or by providing a filename argument. However, if this explicit local destination is omitted and the utility relies on the metadata-stored filename to determine where to write the retrieved content, it becomes susceptible to manipulation by attackers who have access to modify that metadata. The core technical flaw lies in the lack of validation for special characters within these stored filenames, particularly the hyphen character which signifies standard output in Unix-like environments when used as a standalone argument or filename placeholder.

When an attacker with sufficient privileges to alter file metadata sets the GridFS filename attribute to a single hyphen, they effectively trick the mongofiles utility into interpreting this value not as a literal filename but as an instruction to write data to stdout. This behavior is consistent with standard command-line utilities that use '-' to denote standard output streams. Consequently, when an authorized user subsequently attempts to retrieve this specific file using get_id without specifying a local destination, the tool writes the binary content of the GridFS object directly to the terminal or console window rather than saving it as a discrete file on the disk. This mechanism bypasses traditional access controls that might restrict direct reading of certain files from the database because the retrieval itself is performed by an authorized user who has permission to read the metadata and initiate the download process, even if they do not have explicit permissions to view the raw content in other contexts or through different interfaces.

The operational impact of this vulnerability centers on information disclosure and potential data exfiltration. If the environment where mongofiles is executed captures standard output—for instance, by logging terminal sessions, redirecting stdout to a log file, or using screen recording software—the attacker can gain access to sensitive GridFS content that they would otherwise be unable to retrieve directly. This scenario requires a specific chain of events: first, the attacker must modify the metadata to set the filename to '-', and second, an authorized operator must execute the retrieval command without providing an explicit local output path. The success of exploitation also depends on the availability of mechanisms for the attacker to access the captured standard output stream. In environments where terminal logs are stored in directories accessible to lower-privileged users or where stdout is routinely redirected to shared log files, this vulnerability can lead to the unauthorized exposure of confidential documents, images, or other data objects stored within MongoDB's GridFS system.

From a classification perspective, this vulnerability aligns with CWE-20 Improper Input Validation and CWE-73 External Control of File Name or Path. The failure lies in the application not sanitizing or validating the filename retrieved from the database before using it as an output destination parameter. Furthermore, within the context of the MITRE ATT&CK framework, this behavior can be associated with techniques involving data exfiltration over alternative protocols or channels, specifically leveraging standard I/O redirection to bypass direct file access restrictions. The attack vector is primarily local but requires initial access to modify database metadata, placing it in a category that blends privilege escalation aspects with lateral movement through shared resources like log files.

Mitigation strategies for this vulnerability involve both immediate patching and long-term architectural improvements. MongoDB has addressed this issue by updating the mongofiles utility in versions 100.20.1 and later to ensure that filenames containing special characters are handled safely, preventing them from being interpreted as system commands or stream identifiers. Organizations running affected versions between 3.1.4 and 100.20.1 should upgrade their MongoDB Database Tools immediately to eliminate the risk of unintended stdout redirection. Additionally, administrators can implement procedural controls by enforcing strict usage policies that require explicit specification of local output destinations for all GridFS retrieval operations, thereby removing reliance on metadata-stored filenames as default outputs. Monitoring and restricting access to terminal logs or stdout capture mechanisms in shared environments also reduces the attack surface available to potential exploiters seeking to harvest captured data streams.

Responsible

Mongodb

Reservation

10/30/2026

Disclosure

11/03/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!