Summary
WWBN AVideo contains a SQL injection vulnerability where the unauthenticated RTMP on_publish callback directly interpolates the stream key into SQL queries without parameterized binding.
An attacker can abuse this endpoint using time-based blind SQL injection to gradually extract sensitive database contents, including user password hashes and email addresses, whenever the RTMP callback is exposed to untrusted clients.
Affected context
This vulnerability appears in WWBN AVideo deployments that:
- Enable the Live plugin and use the RTMP
on_publishcallback atplugin/Live/on_publish.php - Allow RTMP publish attempts from clients that are not fully authenticated at the application layer
- Rely on the
$_POST['name']parameter (stream key) to look up stream and user data via SQL queries
In this context, the on_publish callback is executed as part of the live streaming workflow, and its database calls are performed with the application's database privileges, exposing the entire schema when abused.
Exploit preconditions
- Attack surface: Public-facing RTMP/live streaming endpoint that triggers
plugin/Live/on_publish.php - Required access:
- Network-level ability to reach the RTMP server or any component that forwards
on_publishcallbacks to AVideo - No prior HTTP or application authentication required, as the endpoint is callable unauthenticated
- Trigger point:
- Submission of crafted
$_POST['name'](stream key) values during theon_publishcallback - The parameter is passed into
LiveTransmitionHistory::getLatest()andLiveTransmition::keyExists()which issue SQL queries - Why exploitation is possible:
- The stream key is interpolated directly into SQL strings without parameterized queries or escaping
- Database responses are not reflected directly to the attacker, but timing differences from query execution allow time-based blind inference of query results
Why this happens
The root cause is unsafe construction of SQL queries using untrusted input from $_POST['name'] (the stream key), a textbook instance of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Instead of using prepared statements with bound parameters, the code concatenates the stream key directly into the SQL statement in both LiveTransmitionHistory::getLatest() and LiveTransmition::keyExists(). This pattern treats user-controlled data as part of the SQL syntax rather than as data, allowing attackers to inject arbitrary SQL clauses. Because the endpoint is accessible without authentication and does not return rich error messages, the vulnerability manifests as a time-based blind SQL injection vector, where attackers infer data using delays and side-channel timing behavior.
Potential impact
- Extraction of user account data, including email addresses and password hashes
- Exposure of access tokens, API keys, or configuration secrets stored in the database
- Enumeration of all database tables, schemas, and internal structure
- Tampering with live stream metadata, permissions, or history records
- Creation of rogue administrative accounts or escalation of privileges within the application
- Potential staging point for broader infrastructure compromise if credentials or connection strings are retrieved
General mitigation guidance
Effective mitigation relies on eliminating dynamic SQL construction with untrusted data and enforcing strict separation between data and query syntax:
- Replace all string-concatenated SQL in the live streaming logic with parameterized queries or prepared statements, ensuring the stream key is always bound as a value.
- Introduce a centralized data access layer that prohibits ad-hoc SQL string building and enforces consistent parameter binding across the codebase.
- Normalize the concept of a "stream key" as an opaque identifier with strict validation (length, character set, and format) before it reaches any database routines.
- Apply least-privilege to the database account used by the live streaming plugin so that its role can only read and modify the minimal set of tables required for live transmission.
- Consider implementing application-layer authentication/authorization for RTMP
on_publishcallbacks, so that only legitimate, authenticated publishers can trigger database lookups. - Log unusual query patterns and repeated failed stream key lookups to support detection of injection attempts and help tune defensive measures.
How teams detect issues like this
Detection can focus on both code-level patterns and runtime behavior:
- Static analysis and code review:
- Scan for SQL constructions that interpolate raw PHP variables (e.g.,
$_POST['name'],$stream_key) into query strings. - Flag any uses of concatenation or string interpolation when building
SELECT,UPDATE,INSERT, orDELETEstatements. - Enforce code review guidelines that require prepared statements and forbid direct use of superglobal variables in SQL.
- Policy and CI enforcement:
- Add CI rules or linter configurations that detect and block the introduction of non-parameterized queries in PHP data access layers.
- Use security-focused linters or SAST tools capable of tracking tainted data from request parameters into database calls, particularly in the
plugin/Live/directory. - Runtime monitoring:
- Monitor database logs for anomalous queries, unusually long-running requests, or repeated invocation of similar statements with varying stream key values.
- Track RTMP publish attempts that exhibit high frequency or unusual timing patterns, suggesting blind SQL injection probing.

