/

CVE-2019-25471

Severity:

CRITICAL RISK

(9.8)

Arbitrary File Upload in FileThingie 2.5.7

CVE-2019-25471

Analyzed

Vulnerability type

Category:

Arbitrary File Upload

CWE:

CWE-22

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.php endpoint 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.php and 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.

Sources

SourceLink
github.comgithub.com/leefish/filethingie/archive/master.zip
exploit-db.comexploit-db.com/exploits/47349
vulncheck.comvulncheck.com/advisories/filethingie-arbitrary-file-upload-via-ft2-php

Frequently asked

questions

Yes. If the FileThingie interface is reachable over the network and upload permissions are obtainable, an attacker can exploit the issue remotely by uploading a crafted ZIP and invoking the unzip functionality.

The attacker needs the ability to upload ZIP archives through ft2.php. In some deployments this may require valid credentials, but in others misconfigured or shared access can make it effectively public.

The most robust pattern is to prevent any executable content from being uploaded or extracted into web-accessible locations. Enforce strict allowlists on file types, isolate uploads to non-executable directories, and ensure archive extraction cannot place files outside controlled paths.

Treat all uploaded content as untrusted, apply strong validation and normalization to both file names and paths, avoid executing or serving uploaded files as code, and incorporate security reviews and automated checks into development and deployment pipelines for any file upload or archive-handling features.

Find out what's already
exploitable in your codebase.