Summary
FileThingie 2.5.7 contains an arbitrary file upload flaw in the ft2.php endpoint that allows attackers to upload ZIP archives containing executable PHP files.
By abusing the built-in unzip functionality, an attacker can extract these files into web-accessible directories and execute arbitrary commands through the resulting PHP shells.
Affected context
This vulnerability arises in deployments of FileThingie 2.5.7 where:
- The
ft2.phpendpoint is exposed over HTTP/S - ZIP upload and unzip functionality is enabled
- Extracted files can end up in web-accessible directories executed by the PHP runtime
It is most relevant when FileThingie is used as a general-purpose file manager on publicly reachable or semi-trusted web servers, especially where authentication or upload restrictions are weak or misconfigured.
Exploit preconditions
- Attack surface: HTTP/S interface to FileThingie, specifically requests handled by
ft2.php - Required access: Ability to authenticate or otherwise gain upload rights (in some deployments, this may be weakly protected or misconfigured)
- Trigger point: Uploading a ZIP archive containing PHP files, then invoking the application's unzip feature to extract them into a directory served by the web server
- Why exploitation is possible: The application does not adequately restrict file types, paths, or extraction locations when processing ZIP archives, enabling attackers to place executable PHP files in locations where the web server will interpret them.
Why this happens
The underlying issue is insufficient validation and control over files extracted from user-supplied ZIP archives.
FileThingie accepts ZIP uploads and unpacks them without enforcing strict constraints on:
- Allowed file extensions and MIME types
- Destination directories and write locations
- Whether executable script types (such as
.php) are permitted in web-exposed paths
This maps primarily to path and file handling weaknesses under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), combined with a lack of safe upload handling practices.
The insecure pattern is treating archived user content as trusted and automatically expanding it into locations where the runtime environment will execute it.
Potential impact
- Remote code execution on the web server via uploaded PHP shells
- Full compromise of the affected application instance
- Reading, modifying, or deleting files accessible to the web server process
- Pivoting to other systems reachable from the compromised host
- Installation of backdoors or web shells for persistent access
- Data theft, defacement, or service disruption
General mitigation guidance
Effective mitigation focuses on tightening file upload semantics and isolating extracted content:
- Enforce strict allowlists for file extensions and MIME types, explicitly blocking executable script types (e.g.,
.php,.phtml,.php5) from uploads and ZIP extraction. - Ensure all extracted content is written to non-executable directories that are not mapped to the web server's document root.
- Normalize and validate all file paths derived from ZIP archives so they cannot escape designated upload directories or introduce unexpected locations.
- Run the web server and file management component with least-privilege accounts and without permissions to write into directories that the server executes as code.
- Disable or restrict archive extraction features when not necessary, or gate them behind stricter roles and moderation workflows.
- Apply defense-in-depth controls such as application-level checks that reject or quarantine any archive containing potentially executable content.
How teams detect issues like this
Organizations can look for this class of issue using several approaches:
- Static analysis: Scan code for archive extraction routines that operate on user-controlled ZIP files without extension or path validation, particularly around
ft2.phpand related handlers. - Code review: Examine upload and unzip logic to confirm:
- Presence of strict allowlists for file types
- Sanitization and normalization of extracted paths
- Segregation of uploaded content into non-executable directories
- Runtime monitoring: Monitor web server logs for:
- Requests to newly created PHP files under upload directories
- Unusual sequences of ZIP uploads followed by accesses to new script paths
- Policy enforcement: Use web application firewalls, security scanners, or CI-integrated security tools to flag endpoints that permit archive uploads and execute content from upload directories.

