CVE-2026-119673: mongofiles may write outside the working directory through a symlink
MongoDB Database Tools mongofiles does not resolve existing parent-directory symlinks when validating output paths for getregex. An unauthorized user who can both upload a GridFS file and place a symlink in the operator's download working directory can cause a later retrieval to create a file containing unauthorized user-controlled data outside that directory, using the operator process's filesystem permissions. The issue can occur with default traversal and overwrite settings. Exploitation requires an operator to retrieve matching files from the affected working directory; the demonstrated default behavior creates a new file rather than overwriting an existing file. This issue affects MongoDB Database Tools versions 100.2.0 through versions before 100.20.1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
MongoDB Database Tools mongofilesto a version that resolves this vulnerability.Fixed in 100.20.1
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
Operators using affected MongoDB Database Tools versions who run mongofiles get_regex from a working directory where an unauthorized user can place symlinks are exposed. The unauthorized user must also be able to upload a GridFS file that the operator later retrieves.
Does exploitation require non-default mongofiles options?
No. The issue can occur with the default traversal and overwrite settings. In the demonstrated default behavior, retrieval creates a new file rather than overwriting an existing file.
What user interaction is required for exploitation?
An operator must retrieve matching GridFS files using get_regex from the affected working directory. The resulting file write occurs with the filesystem permissions of the operator process.
What versions are affected?
MongoDB Database Tools versions 100.2.0 through versions before 100.20.1 are affected.