Summary
WWBN AVideo up to version 26.0 contains a path traversal flaw in the pluginRunDatabaseScript.json.php endpoint, where a POSTed name parameter is used to locate SQL installation files without proper sanitization.
An authenticated admin, or an attacker leveraging CSRF, can traverse outside the plugin directory and execute arbitrary install/install.sql files on the server as raw database queries, potentially leading to data compromise or application takeover.
Affected context
This vulnerability occurs in WWBN AVideo deployments where:
- The
objects/pluginRunDatabaseScript.json.phpendpoint is reachable over HTTP(S) - Plugins or core components rely on
Plugin::getDatabaseFileName()to resolve SQL installation scripts - The
nameparameter from POST requests is treated as a filesystem path segment without strict validation
It primarily affects administrative workflows for running plugin database migration scripts, but can be abused outside normal plugin boundaries when path traversal is possible.
Exploit preconditions
- Attack surface: HTTP(S) endpoint
objects/pluginRunDatabaseScript.json.php - Required access:
- Valid authenticated admin session, or
- A logged-in admin targeted with a crafted CSRF request if CSRF protections are weak or missing
- Trigger point: Sending a POST request with a crafted
namevalue containing path traversal sequences that resolve to aninstall/install.sqlfile outside the intended plugin directory - Why exploitation is possible: The
nameparameter is passed directly toPlugin::getDatabaseFileName()without normalizing, constraining, or validating the resulting path to a safe base directory, allowing attackers to reference SQL scripts in arbitrary locations that the application will then execute against the database.
Why this happens
The root cause is insufficient validation of user-controlled path input used to construct filesystem paths to SQL installation scripts.
By trusting the name parameter and not enforcing that the resolved path remains within the expected plugin directory, the code permits directory traversal (../) and similar patterns to escape the intended scope.
This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where path construction logic fails to restrict access to a safe base directory and allows unintended file access and, in this case, execution of the file contents as SQL queries.
Potential impact
- Execution of arbitrary SQL statements contained in reachable
install/install.sqlfiles - Unauthorized schema changes, such as adding, dropping, or altering tables
- Insertion, modification, or deletion of application data, including user accounts and permissions
- Escalation of privileges within the application through manipulated database records
- Indirect compromise of application integrity and availability, including potential data loss
General mitigation guidance
Mitigation should focus on constraining filesystem access and decoupling trust in file-based SQL scripts:
- Enforce path normalization and validation so that any resolved path derived from
nameremains inside a predefined plugin directory and cannot include..or other traversal constructs. - Use whitelisting or mapping: treat
nameas a logical plugin identifier and resolve it via an internal registry or lookup table, not as a raw path fragment. - Ensure that only known, explicitly allowed SQL install scripts can be executed, and avoid generic "run any install.sql file" patterns.
- Restrict file system permissions so the web process can only read migration scripts from controlled directories, limiting the blast radius if path checks fail.
- Apply least-privilege principles to the database account used by the application, reducing the scope of damage possible from unintended SQL execution.
How teams detect issues like this
Effective detection combines code-centric and operational approaches:
- Static analysis: Flag uses of user-controlled variables in filesystem path construction, especially where the result is passed to file APIs or database execution routines without normalization and directory checks.
- Code review signals: Look for:
- Direct concatenation of request parameters into paths (e.g.,
$baseDir . $_POST['name']) - Lack of checks for
.., absolute paths, or null bytes - Generic logic that executes the contents of files as SQL without strong contextual checks
- Logging and monitoring:
- Log invocations of
pluginRunDatabaseScript.json.phpincluding normalized target paths (without logging sensitive data). - Monitor for unusual or repeated attempts to reference unexpected directories via the
nameparameter. - Security testing: Use focused dynamic testing to probe path traversal patterns in endpoints that load or execute migration or installation scripts.
- Automated code review or SAST tools can be configured to flag path traversal patterns and dangerous combinations of file access plus SQL execution.

