Summary
WWBN AVideo's HLS streaming endpoint (view/hls.php) contains a path traversal flaw that lets an unauthenticated attacker bypass access controls by manipulating the videoDirectory parameter.
Under specific path patterns, authorization is performed on one video identifier while the file system serves segments from a different path, enabling unauthorized streaming of private or paid videos.
Affected context
This vulnerability appears in WWBN AVideo deployments that expose the view/hls.php HLS streaming endpoint and rely on it to enforce access rules for private or paid content.
It is triggered when the videoDirectory GET parameter is used both for determining authorization and for resolving the underlying file path, but parsed differently in those two steps.
Environments where HLS playlists and segments for private or paid videos are stored in predictable directory structures are particularly exposed.
Exploit preconditions
- Attack surface: Publicly accessible HLS streaming endpoint (
view/hls.php) over HTTP(S). - Required access: No prior authentication; attacker only needs network reachability to the AVideo instance.
- Trigger point: Supplying a crafted
videoDirectoryvalue that: - Appears to reference one logical video during authorization (due to truncation at the first
/), while - Resolving to a different path containing the target content when used for filesystem access (preserving
..). - Why exploitation is possible: The same parameter is interpreted in two inconsistent ways—one sanitized for authorization logic and one used more directly for file access—creating a split-oracle condition that breaks the coupling between access checks and actual content served.
Why this happens
The issue stems from inconsistent handling of a path-like parameter that is reused across authorization and file access logic.
In the authorization branch, the videoDirectory parameter is normalized or truncated at the first /, effectively stripping traversal sequences and deriving a canonical video identifier.
In the file access branch, the same parameter is used in a more raw form, allowing .. path traversal sequences to influence the resolved filesystem path.
This disconnect maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user input controls path resolution outside intended boundaries.
Conceptually, the security check is applied to a sanitized surrogate value, but the effect of the untrusted input is preserved when interacting with the file system, enabling access to resources that were never actually authorized.
Potential impact
- Unauthorized streaming of private videos that should be restricted to specific users or roles.
- Unauthorized access to paid or premium video content without purchase.
- Exposure of internal media assets or test content not intended for public distribution.
- Potential inference of directory structures or media organization within the platform.
- Revenue loss and contractual or regulatory compliance issues due to leakage of protected content.
General mitigation guidance
Reducing risk focuses on aligning authorization decisions with the exact resource being served and strictly constraining filesystem access:
- Derive an internal, immutable video identifier from trusted data (e.g., database lookup) and use it consistently for both authorization and path resolution, instead of trusting a client-provided directory name.
- Implement a canonicalization step that normalizes any path-related input and then validate it against a strict allowlist before use, rejecting any input containing traversal patterns (
.., absolute paths, or unexpected separators). - Enforce a fixed base directory for HLS playlists and segments, and construct file paths by joining this base with validated identifiers rather than raw user input.
- Decouple URL-facing identifiers from actual filesystem structure; for example, map short tokens or numeric IDs to media paths on the server side.
- Apply least-privilege file permissions so the web process can only read media directories that are intended for web delivery, limiting the blast radius of any path miscalculations.
How teams detect issues like this
Detection generally relies on reviewing both code and behavior for inconsistent path handling:
- Static analysis patterns:
- Searches for direct use of user-controlled parameters (e.g.,
$_GET['videoDirectory']) in filesystem functions likefile_exists,fopen, or directory traversal without canonicalization. - Rules that flag use of
..or raw request parameters in path concatenations. - Checks for inconsistent sanitization where a parameter is validated or truncated in one function but reused unsafely in another.
- Code review signals:
- A single input parameter driving both authorization decisions and direct file path resolution.
- String manipulation that alters the parameter for permission checks (e.g., splitting on
/) without ensuring the same representation is used when opening files. - Lack of centralized path construction helpers that enforce a safe base directory.
- Policy enforcement and tooling:
- Incorporating security-focused linters or SAST tools into CI to flag path traversal patterns and unvalidated filesystem access.
- Writing unit and integration tests that attempt to access protected media using crafted directory names containing extra path segments or traversal tokens.

