Summary
Adminer before 5.4.3 contains a path traversal flaw in SQLite mode that allows an authenticated attacker to submit an arbitrary relative file path to the database-list deletion action.
If the PHP process can write to the targeted location, the attacker may delete files outside the intended database directory, potentially disrupting the application or other services.
Affected context
The vulnerability occurs in Adminer deployments using SQLite mode when the database-list drop action accepts file paths through the db[] parameter without adequately restricting their extensions or location. Exploitation depends on the attacker having authenticated access to the relevant Adminer functionality and the PHP process having write permission for the targeted files.
Exploit preconditions
- Attack surface: Adminer SQLite database-list drop action
- Required access: Authenticated access to Adminer with permission to invoke the database deletion function
- Trigger point: Submission of a crafted relative path through the
db[]parameter - Why exploitation is possible: The deletion logic does not sufficiently validate the file extension or constrain the resolved path to an intended database directory, allowing writable files elsewhere to be selected
Why this happens
The underlying bug is insufficient path and file-type validation before a filesystem deletion operation. User-controlled path data is trusted by the SQLite database-list drop action without enforcing a strict allowlist of database files or canonicalizing and constraining the final path to an approved directory.
This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The insecure pattern occurs when an application combines attacker-influenced path components with filesystem operations without reliably enforcing directory boundaries and permitted file types.
Potential impact
- Deletion of SQLite database files or other writable application files
- Loss of application data or database availability
- Disruption of services that depend on deleted files
- Corruption of application state or configuration
- Further compromise if deletion removes security controls or operational safeguards
General mitigation guidance
Mitigation generally focuses on reducing trust in user-supplied paths and ensuring deletion is limited to explicitly approved resources.
Common defensive patterns include:
- Representing selectable databases with server-side identifiers rather than client-supplied filesystem paths
- Enforcing strict allowlists for permitted file extensions and database locations
- Canonicalizing paths and verifying that the resolved target remains within an approved directory
- Rejecting path separators, traversal components, symlinks, and unexpected path forms where they are not required
- Applying least-privilege filesystem permissions to the PHP process
- Requiring explicit authorization and confirmation for destructive operations
- Using separate storage locations and service identities to limit the consequences of file deletion
How teams detect issues like this
Detection can combine code review, static analysis, and runtime monitoring.
Useful review and analysis signals include:
- Filesystem deletion calls that receive request parameters directly or through weakly validated helpers
- Path concatenation involving
db[], query parameters, form fields, or other client-controlled values - Extension checks performed without canonical path validation
- Missing checks that compare resolved paths against an approved directory
- Delete operations that do not account for symbolic links or alternate path representations
Policy enforcement can require centralized path-validation helpers, restrict destructive filesystem APIs in request handlers, and alert on unusual deletion activity by the PHP process.

