Summary
A critical vulnerability in Adminer before 5.4.3 allows unauthenticated attackers to inject ODBC parameters into a PDO connection string through the server field. Under deployments where the resulting trace file is written inside the web root and later accessed, this may enable PHP code execution and remote compromise.
Affected context
The vulnerability occurs in Adminer deployments that accept attacker-influenced server connection data and incorporate it into a PDO DSN without adequately restricting driver-specific parameters. Risk is highest when ODBC tracing is available, trace output can be directed into a web-accessible directory, and the generated file is interpreted as PHP when requested.
Exploit preconditions
- Attack surface: Adminer database connection handling and PDO DSN construction
- Required access: Ability to reach the Adminer interface; authentication may not be required for the vulnerable input path
- Trigger point: Processing of the server field while constructing the connection string
- Why exploitation is possible: Semicolon-delimited ODBC parameters can influence trace behavior and file placement, potentially causing attacker-controlled content to be written into a web-accessible location
Why this happens
The underlying bug is insufficient validation and trust-boundary enforcement for a user-controlled server value used in a file-affecting connection configuration. Because the value is inserted into a PDO DSN without restricting unexpected ODBC parameters, an attacker may influence trace file names and tracing behavior. This maps to CWE-73: External Control of File Name or Path, where externally controlled input affects filesystem locations or file creation.
Potential impact
- Attackers may write attacker-controlled content to a web-accessible file
- PHP code execution may occur when the written file is processed by the web server
- The Adminer host or connected application environment could be compromised
- Database credentials and other server-side secrets may be exposed
- The vulnerability could enable follow-on persistence or lateral movement
General mitigation guidance
Mitigation generally focuses on reducing trust in connection parameters and preventing user-controlled values from influencing filesystem behavior.
Common defensive patterns include:
- Restricting server and driver parameters to an explicit allowlist
- Avoiding direct concatenation of untrusted values into DSN strings
- Disabling or tightly constraining database-driver tracing where it is unnecessary
- Ensuring trace and temporary files are stored outside web-accessible directories
- Preventing script execution in directories used for generated or diagnostic files
- Running database administration tools with least privilege and limited filesystem access
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis of DSN construction and concatenation involving request parameters
- Code review checks for semicolon-delimited driver options accepted from untrusted input
- Runtime monitoring for unexpected ODBC trace settings or files created under web roots
- Web-server and filesystem logs showing unusual requests for newly created PHP files
- Policy enforcement that blocks script execution in upload, cache, trace, and temporary directories
- Automated security review tools that flag external input reaching file paths or database driver options

