Summary
A critical unrestricted file upload vulnerability in dulldusk/phpfm allows unauthenticated attackers to upload files containing PHP code. When the uploaded file is stored in a web-accessible location and interpreted by the server, the attacker may execute arbitrary commands remotely.
Affected context
The issue may occur in PHPFM deployments through version 1.8.0 where the upload extension filter remains empty and authentication is not enabled by default. Risk is greatest when uploaded files are placed beneath a PHP-enabled, web-accessible directory and the application does not enforce server-side type and content restrictions.
Exploit preconditions
- Attack surface: The application's file upload functionality and web-accessible uploaded-file paths
- Required access: Network access to the application; authentication may not be required when default authentication settings remain enabled
- Trigger point: Upload handling followed by a request to the stored file
- Why exploitation is possible: File extensions and executable content are insufficiently restricted, allowing server-interpreted PHP files to be stored and invoked
Why this happens
The vulnerability results from treating client-controlled uploaded files as acceptable content without enforcing a restrictive allowlist, independent content validation, and safe storage behavior. An empty upload-extension filter can permit executable script types, while placing uploads in a PHP-enabled web directory can cause the server to interpret attacker-controlled content. This maps to CWE-434: Unrestricted Upload of File with Dangerous Type.
Potential impact
- An attacker may execute arbitrary PHP code on the server
- The application and its stored data could be compromised
- Credentials, configuration secrets, or user files may be exposed
- The server may be used for persistence, malware delivery, or lateral movement
- Availability could be affected through destructive or resource-intensive actions
General mitigation guidance
Mitigation generally focuses on reducing trust in uploaded content and ensuring that uploads cannot become executable server resources.
Common defensive patterns include:
- Permit only narrowly required file types using a server-side allowlist
- Validate file signatures and content in addition to filename extensions
- Store uploads outside the web root or on a separate non-executable storage service
- Disable script execution in upload locations through web-server policy
- Generate server-controlled filenames and normalize paths
- Require authentication and authorization for upload operations
- Apply least-privilege permissions to the application and uploaded files
- Enforce upload size, rate, and resource limits
How teams detect issues like this
Organizations can identify this class of issue through:
- Static analysis rules for unrestricted upload handlers and extension checks based only on client input
- Code review checks for empty or permissive upload allowlists
- Tests verifying that uploaded script types are rejected or stored outside executable paths
- Web-server policy reviews for script execution in upload directories
- Monitoring for unexpected executable extensions, anomalous upload activity, and requests to newly uploaded files
- CI security policies requiring authentication, content validation, and non-executable upload storage
Automated code review and application security testing tools may help flag dangerous upload flows, but deployment configuration should also be assessed.

