FileDrop’s path traversal flaw comes from trusting a username as a filesystem directory. Although the application sanitizes the filename and authenticates each request, a newly registered user can choose a username containing path segments that redirect file operations toward another account’s directory. The core lesson: a value does not become trusted because it is later read from a database or JWT.
How FileDrop is supposed to protect files
FileDrop is a personal file-storage service with an Express/Node backend, a React single-page frontend, MongoDB user records, files on the container filesystem, and JWT bearer tokens sent in the Authorization header. Its stated design promise is: “Every account has its own storage area on disk; the files in it are private to that account.”
The review follows the data from user stories and input points to the filesystem operations that consume it. That matters because the flaw is not simply a missing check on a file ID: it is a path-construction error that undermines the intended separation between accounts.
Where the path becomes unsafe
For file operations, the application constructs a location from the storage root, the authenticated user’s username, and a filename. It applies path.basename to the filename, but does not constrain the username to a safe, single directory name. Registration checks the username’s type and length, yet the solution article reports that slash characters and dot segments remain permitted.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Node’s official path documentation explains that path.join() joins path segments using the platform-specific separator and normalizes the result; normalization resolves .. and . segments. In other words, joining a path does not make untrusted segments safe. The precise separator behavior is platform-dependent, so the example below is specifically the article’s POSIX-style storage-root scenario.
Why filename sanitization is not enough
path.basename(filename) limits the filename component, but the username is another value reaching the same path sink. Every component must be traced to its original source and checked against its role. A username originally chosen at registration is still user input when retrieved later from MongoDB or included in a JWT claim.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
What the example usernames resolve to
The solution article describes a new account registering with username x/../casey. In its POSIX-style example, the x segment is canceled by .., so the resulting directory is Casey’s folder under the storage root. The article says the attacker can then list, download, overwrite, or delete Casey’s files through ordinary authenticated file APIs.
| Username segment in the example | Normalized destination | Inside storage root? |
|---|---|---|
../casey |
A neighboring path outside the storage root, in the article’s example | No |
x/../casey |
Casey’s folder beneath the storage root, in the article’s example | Yes, but it is another user’s folder |
The distinction matters: staying under the storage root is necessary but not sufficient for account isolation. The second example is inside the root while still targeting the wrong account. The solution article also describes usernames with additional traversal segments escaping the storage root. These exploit behaviors are attributed to that article; they were not independently executed for this explanation.
Recommended Free Tools
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Which existing defenses do and do not address it
The solution article reports that the reviewed API file routes require authentication, JWT verification pins HS256, filenames are reduced to their basenames, MongoDB operator injection is addressed through sanitization and string checks, and React JSX escapes rendered values. Those controls address other risks, but they do not make a user-chosen username safe to insert into a filesystem path.
- Authentication: proves a caller has a valid session; it does not ensure the caller’s chosen directory is their own.
- Filename basename checks: constrain the filename component, not the username component.
- JWT verification: validates the token according to the configured algorithm; a claim copied from user-controlled registration data does not thereby become a safe path segment.
- Database sanitization and JSX escaping: concern database operators and browser rendering, not filesystem path resolution.
The issue is classified by the solution article as Path Traversal (CWE-22) and External Control of File Name or Path (CWE-73). Its access-control impact arises because path construction can direct an authenticated operation into a different user’s storage area.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
How to fix the storage identity
Prefer a server-generated immutable directory ID
Use a server-generated immutable user ID as the directory name rather than the display username. This removes attacker-chosen username text from the storage path and keeps later username changes from changing a user’s filesystem identity. The username can remain a display or login value without serving as the directory key.
Use a strict allowlist if usernames must be directory names
If the application must use usernames as directory names, validate them against a strict allowlist that excludes path separators and dot segments. This is a useful input-validation control, but the directory identity remains coupled to a user-facing value, so it is weaker than using an immutable server-generated ID.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Quick Recap
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Verify resolved paths and enforce ownership
- Resolve the final directory and confirm it remains beneath the configured storage root before using it.
- Apply the same protection in the upload destination callback. Upload middleware may write a file before the route handler runs, so a check only in the handler can be too late.
- Track file ownership in the database and check it for downloads and deletions, rather than relying solely on a constructed path.
- Keep filename basename checks as an additional defense; they are useful, but do not replace validation of every path component.
A practical review trace
- Map the promise: identify which account should be able to list, upload, download, overwrite, and delete each file.
- Find path inputs: trace the storage root, username, filename, and any other components from their original source through database records and token claims.
- Identify the sink: inspect every filesystem operation and upload middleware destination that consumes the constructed path.
- Check normalization and containment: reason about the platform-specific path behavior, then verify the resolved destination remains within the correct account directory, not merely somewhere under the shared root.
- Test defenses by component: confirm each user-controlled segment is constrained and that ownership checks cover read and write operations.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

