Summary
WWBN AVideo up to and including version 26.0 contains an SQL injection vulnerability in the Subscribe::save() method, where unsanitized user input is directly concatenated into an INSERT query.
An authenticated attacker can supply crafted user_id values via POST requests to subscription endpoints and execute arbitrary SQL, potentially extracting sensitive data from any database table.
Affected context
The vulnerability occurs in WWBN AVideo's subscription handling logic, specifically within objects/subscribe.php when processing subscription-related requests.
The Subscribe::save() method builds an INSERT statement using the $this->users_id property, which is taken directly from $_POST['user_id'] in subscribe.json.php and subscribeNotify.json.php without parameterization.
Any deployment that exposes these endpoints to authenticated users and connects to a relational database backend is potentially affected.
Exploit preconditions
- Attack surface: HTTP endpoints handling subscription actions, such as
subscribe.json.phpandsubscribeNotify.json.php. - Required access: Valid authenticated user session with permission to trigger subscription actions.
- Input control: Ability to set or influence the
user_idPOST parameter in requests to the vulnerable endpoints. - Trigger point: Invocation of
Subscribe::save()where the unsanitized$this->users_idvalue is concatenated into an INSERT SQL query. - Why exploitation is possible: The code uses string concatenation for SQL construction instead of prepared statements or safe parameter binding, allowing attacker-controlled input to alter the SQL structure.
Why this happens
This vulnerability stems from constructing SQL queries through direct string concatenation of user-controlled data, a classic instance of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
The Subscribe::save() method trusts $this->users_id—sourced from $_POST['user_id']—and interpolates it into an INSERT statement without proper parameterization or escaping.
Because the application does not enforce strict typing, validation, or prepared statements, any special SQL characters or fragments injected into user_id are interpreted by the database engine as part of the query logic rather than data.
Potential impact
- An attacker could read sensitive data from arbitrary tables (e.g., password hashes, API keys, encryption salts).
- An attacker could access or enumerate user account information and other confidential records.
- An attacker could potentially modify or delete data, impacting application integrity and availability.
- An attacker could leverage knowledge of password hashes and salts for offline cracking of user credentials.
- An attacker could combine data leakage with other weaknesses to escalate privileges or pivot within the environment.
General mitigation guidance
Security hardening should focus on eliminating dynamic SQL string construction and reducing trust in client-supplied identifiers:
- Use parameterized queries or prepared statements for all database interactions, ensuring user input is always treated as data, not code.
- Enforce strict input validation and type checks on identifiers such as
user_id(e.g., integer-only constraints, server-side checks). - Centralize database access layers so query construction patterns can be standardized and audited for unsafe concatenation.
- Apply least-privilege principles to the database user so that compromise of a single query path limits access scope.
- Consider employing an ORM or query builder that encourages parameter binding as the default pattern.
How teams detect issues like this
Detection efforts can combine code-centric and behavior-centric approaches:
- Static analysis: Configure rules to flag SQL queries built via string concatenation or interpolation of
$_POST,$_GET, or other user-controlled variables. - Code review: Look for patterns where variables such as
user_id,users_id, or similar are inserted directly into SQL without binding; pay attention tosubscribe.phpand related JSON endpoints. - Database monitoring: Enable logging of slow or unusual queries and alert on anomalous patterns that include typical injection markers or unexpected concatenation.
- Automated testing: Use security testing tools or fuzzers that send crafted payloads to subscription-related endpoints and check for SQL errors or data leakage.

