Summary
Adminer versions before 5.4.3 contain an unrestricted file upload vulnerability in the AdminerFileUpload plugin. An authenticated user may upload PHP files when permissive extension rules allow them and could execute arbitrary code as the web-server user if the configured upload directory is web-accessible.
Affected context
The vulnerability occurs in deployments using the AdminerFileUpload plugin with a permissive default extension allowlist. Risk increases when users can upload files to columns ending in _path and the configured uploadPath is served directly by the web server, allowing uploaded PHP content to be interpreted as executable code.
Exploit preconditions
- Attack surface: Authenticated file-upload functionality in the AdminerFileUpload plugin
- Required access: A valid Adminer account with permission to use the affected upload feature
- Trigger point: Upload handling for columns ending in
_path - Required configuration: The uploadPath must be accessible through the web server and capable of interpreting uploaded PHP files
- Why exploitation is possible: Extension validation permits executable server-side files, and uploaded content may subsequently be processed as web application code
Why this happens
The underlying flaw is an insufficiently restrictive file-upload policy. The plugin permits potentially executable file types through its default extension allowlist without reliably separating uploaded data from server-executable content.
This maps to CWE-434: Unrestricted Upload of File with Dangerous Type, where an application accepts a file type that can affect server behavior. The risk is amplified when upload storage is located within a web-served path.
Potential impact
- An attacker may execute arbitrary code with web-server privileges
- The application or its associated database could be compromised
- Uploaded files could be used to alter application content or configuration
- Sensitive data accessible to the web-server account could be disclosed
- The host may be used for further attacks, depending on process privileges and network access
General mitigation guidance
Mitigation generally focuses on preventing uploaded content from becoming executable and reducing trust in user-controlled file metadata.
Common defensive patterns include:
- Allowing only narrowly required, non-executable file types through an explicit allowlist
- Storing uploads outside web-served directories or on isolated storage
- Serving uploaded content through a non-executable download mechanism
- Verifying file type using content inspection rather than relying only on extensions
- Generating server-side filenames and preventing user-controlled path selection
- Applying least-privilege permissions to the web-server process and upload directory
- Enforcing authentication, authorization, size limits, and audit logging for upload operations
How teams detect issues like this
Detection approaches may include:
- Static analysis rules identifying upload handlers with permissive extension lists or user-controlled paths
- Code review checks for uploads stored beneath web roots or passed to executable handlers
- Policy enforcement requiring explicit non-executable upload destinations
- Monitoring for PHP or other server-side script files appearing in upload directories
- Reviewing web-server logs for requests targeting newly uploaded files
- Automated security review tools that flag dangerous file-upload configurations

