Summary
Manyfold suffers from a path traversal flaw where authenticated users can rename uploaded files using crafted filenames that escape the intended library directory.
By embedding traversal sequences in the filename, an attacker may cause files to be moved or written outside the configured storage path, risking data exposure or overwrite.
Affected context
This vulnerability occurs in Manyfold's handling of uploaded model files when users rename those files through the web application.
The application concatenates a user-controlled filename with the model's base path using File.join without normalizing or validating the resulting path.
Deployments where the application user account has write access beyond the designated library directory are more exposed because renamed files can be relocated or written into unintended locations.
Exploit preconditions
- Attack surface: Authenticated web interface for managing and renaming 3D model files
- Required access: Valid user account with permission to upload or rename files
- Trigger point: Submission of a filename containing path traversal sequences (e.g.,
../) during a rename operation - Why exploitation is possible: The filename is treated as a trusted path component, combined via
File.joinwithout canonicalization or validation, enabling traversal outside the configured library directory
Why this happens
The underlying bug stems from treating a user-supplied filename as a safe filesystem path component.
In the affected code, File.join(model.path, filename) is used directly, so .. and other traversal patterns embedded in the filename remain effective and are not constrained to the intended directory.
This aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory and CWE-73: External Control of File Name or Path, where external input controls which filesystem locations are accessed rather than using a strictly validated or canonical path.
Potential impact
- Files may be moved or created outside the configured library directory
- Sensitive application or system files could be overwritten, depending on filesystem permissions
- Unintended disclosure of files stored elsewhere on the same filesystem
- Disruption of Manyfold's data integrity, including loss or corruption of 3D model assets
General mitigation guidance
Mitigation centers on ensuring that user-provided filenames cannot influence the actual filesystem path beyond the allowed storage directory.
Common defensive patterns include:
- Normalizing and validating paths after concatenation, then enforcing that they remain within a configured base directory
- Rejecting filenames containing path traversal sequences, absolute paths, or special directory tokens
- Using generated, server-side identifiers for filesystem paths and treating user-visible names as metadata only
- Applying least-privilege filesystem permissions so the application account cannot write to sensitive locations outside its data directory
How teams detect issues like this
Detection can focus on both code-level and runtime signals:
- Static analysis rules that flag uses of
File.join,open, or other file APIs where any argument is derived from request parameters or user input without validation - Code review checklists that highlight path handling logic and require explicit validation against a known base directory
- Application logging of file rename and move operations, followed by monitoring for paths that resolve outside the expected library root
- Security tests or fuzzing that attempt to use
../and other traversal patterns in filenames to verify that they are rejected or safely handled

