This vulnerability lives in the gap between what the GridFS API promises and what it actually does. When you pass a filename, document ID, or user-derived slug to GridFS operations, the driver treats that identifier as a query condition rather than a literal value. The API gives no signal that this is happening — no warnings, no documentation of required escaping, nothing at the interface boundary to indicate that identifiers require the same sanitization you'd apply to raw query parameters.

The impact is severe because this isn't a subtle bypass. A malicious identifier can trigger mass file deletion across an entire bucket, read documents across tenant boundaries, or cause rename operations to modify the wrong file. The rename atomacity violation is the tell: the operation executes against documents that matched the query, not the file you intended. Your application owns the identifier — the driver owns the query construction, and it's constructing something dangerous.

Audit every location where user-controlled values flow into GridFS bucket operations: find, delete, rename, downloadByName. Treat those values as query parameters and apply the same sanitization your application's data layer uses for other MongoDB queries. The driver should parameterize these identifiers transparently; until it does, the abstraction is a liability, not a convenience.