Summary
WWBN AVideo up to and including version 26.0 contains a SQL injection vulnerability in the getLike() method of objects/like.php, where videos_id is concatenated directly into a query string.
An attacker who can control the videos_id parameter through crafted requests may inject arbitrary SQL, potentially reading, modifying, or deleting data despite partial use of prepared statements.
Affected context
The vulnerability appears in the getLike() method responsible for retrieving like information associated with videos.
The query uses a prepared statement placeholder for users_id but embeds $this->videos_id directly into the SQL string, without parameterization or robust input validation.
This issue typically manifests in deployments where user-supplied values are used to set videos_id, such as via HTTP request parameters or route variables, and the application connects to a relational database with sufficient privileges to access user, video, or other business-critical tables.
Exploit preconditions
- Attack surface: Web-facing endpoints that ultimately call
objects/like.php::getLike()and allow the client to influencevideos_id. - Required access: Ability to send crafted HTTP requests to the AVideo instance; no direct database access is required.
- Trigger point: Invocation of
getLike()with an attacker-controlledvideos_idvalue that is concatenated into the SQL query. - Why exploitation is possible: The code mixes parameterized and non-parameterized input handling:
users_idis bound as a prepared-statement parameter, whilevideos_idis interpolated directly into the SQL string. This selective parameterization leaves a portion of the query structure controllable by the attacker, enabling injection.
Why this happens
This vulnerability is a classic instance of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
The underlying bug is the unsafe construction of SQL using string concatenation for $this->videos_id instead of binding it as a parameter in the prepared statement.
By allowing user-controllable data to participate directly in the SQL syntax (e.g., inside a WHERE clause) without neutralization or parameterization, the query parser interprets injected tokens as part of the command rather than data.
The presence of a prepared statement for users_id may give a false sense of security, but partial use of prepared statements does not protect fields that remain embedded directly into the SQL string.
Potential impact
- An attacker could read sensitive information from other tables, including user records or configuration data, if database permissions allow.
- An attacker could modify or delete video metadata, likes, or related content stored in the database.
- An attacker could create or escalate application-level accounts or permissions by manipulating authentication- or authorization-related tables.
- Under permissive database configurations, an attacker could manipulate database schema or plant malicious data for subsequent attacks.
- In some environments, SQL injection could be chained with other weaknesses to impact the underlying host or adjacent services.
General mitigation guidance
Effective mitigation focuses on eliminating unsafe query construction and reducing the trust placed in client-supplied identifiers:
- Treat all inputs that influence SQL, including IDs like
videos_id, as untrusted and always bind them as parameters in prepared statements rather than interpolating them into query strings. - Use a database abstraction layer or ORM that encourages query building through parameterized APIs instead of manual string concatenation.
- Centralize data access logic so that all SQL is constructed through vetted helper functions that enforce parameterization by default.
- Apply strict server-side validation and normalization of identifier fields (e.g., enforcing numeric types and expected ranges) before they are used in any database operations.
- Configure database accounts with least-privilege access, limiting the impact of any injection attempt to only the data and operations required by AVideo.
How teams detect issues like this
Organizations can detect and monitor for this class of issue using a combination of proactive and reactive approaches:
- Static analysis: Use SAST tools or custom rules to flag direct concatenation of variables into SQL strings, especially where only some parameters are passed via prepared statements.
- Code review: During manual review, pay attention to data access layers and look for mixed patterns where some fields are parameterized but others are interpolated directly.
- Security testing: Employ dynamic application security testing (DAST) or manual penetration testing to send crafted inputs through endpoints that reference
videos_idand observe for SQL error messages or anomalous responses. - Logging and monitoring: Monitor database logs for unusual queries with unexpected structure and application logs for SQL errors that might indicate injection attempts.

