/

CVE-2026-33717

Severity:

HIGH RISK

(8.8)

Unrestricted File Upload in WWBN AVideo Encoder Endpoint

CVE-2026-33717

Analyzed

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution via Web-Accessible Uploaded File

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

WWBN AVideo up to version 26.0 contains an unrestricted file upload flaw in the downloadVideoFromDownloadURL() function that allows remote content to be stored under the web root with attacker-controlled filenames and extensions, including .php.

By abusing error handling around the resolution parameter, an attacker can cause uploaded temporary files to remain in a web-accessible cache directory, potentially enabling remote code execution through direct HTTP requests to the dropped PHP file.

Affected context

This vulnerability arises in WWBN AVideo deployments that:

  • Expose the aVideoEncoder.json.php endpoint and allow users to request downloads from remote URLs
  • Store downloaded content in videos/cache/tmpFile/ or a similar web-accessible directory
  • Use the original remote filename and extension (including .php) when saving temporary files
  • Invoke forbiddenPage() and terminate execution early when encountering an invalid or unexpected resolution parameter

The issue manifests when the temporary file is created before validation and cleanup, but not subsequently removed or moved due to premature termination.

Exploit preconditions

  • Attack surface: HTTP(S) endpoint objects/aVideoEncoder.json.php reachable from the attacker's environment.
  • Required access: Ability to send crafted requests to the encoder API with attacker-controlled downloadURL and resolution parameters (typically unauthenticated or low-privileged web access, depending on deployment).
  • Trigger point:
  • The attacker supplies a downloadURL pointing to content they control, using a filename ending in .php or another executable extension recognized by the web server.
  • The attacker provides an invalid resolution value that causes forbiddenPage() to be invoked.
  • The function creates a temporary file in videos/cache/tmpFile/ and then dies before moving or deleting it.
  • Why exploitation is possible:
  • Downloaded content is saved using the original filename and extension directly under a web-served directory without enforcing safe extensions or performing robust validation before making it reachable.
  • The error path short-circuits cleanup logic, leaving the temporary file persistently accessible to subsequent HTTP requests.

Why this happens

The core bug is an unrestricted file upload pattern where remote content is fetched and stored using attacker-controlled filenames and extensions in a directory that is served by the web server. This maps to CWE-434: Unrestricted Upload of File with Dangerous Type.

The downloadVideoFromDownloadURL() function writes the downloaded file to a temporary path under videos/cache/tmpFile/ based directly on the remote URL's name, including .php. Validation of parameters such as resolution, and any cleanup or relocation of the temporary file, occur after the file write. On invalid input, the code calls forbiddenPage() and terminates with die() before the cleanup and enforcement steps execute. The result is a PHP file, whose content is chosen by the attacker, sitting in a location that the web server interprets and executes. The unsafe combination of:

  • trusting the remote filename and extension,
  • writing to a web-accessible directory, and
  • failing to clean up on error paths

produces a classic remote web shell / arbitrary code upload condition.

Potential impact

  • Execution of arbitrary PHP code on the server by requesting the dropped file directly.
  • Establishment of a persistent web shell for interactive access and further compromise.
  • Reading or modification of application configuration and database contents via executed PHP code.
  • Lateral movement to other services hosted on the same server or network.
  • Defacement or modification of hosted video content and site behavior.
  • Use of the compromised server for malware hosting, spam campaigns, or further attacks.

General mitigation guidance

Effective mitigation centers on constraining file handling, separating storage from execution, and hardening error paths:

  • Avoid using attacker-controlled filenames and extensions; instead, generate server-side random names with a safe, non-executable extension (e.g., .bin, .dat) and store metadata separately.
  • Ensure that all upload or download staging directories are outside the web root or configured as non-executable in the web server (e.g., disabling PHP execution in cache/temp directories).
  • Enforce strict allowlists for file types and content: validate by MIME type and, where practical, by inspecting headers or file signatures rather than relying on extensions.
  • Normalize and validate all user-supplied parameters (including resolution) before writing any files, so that invalid requests fail before disk writes occur.
  • Implement robust cleanup logic that is not bypassed by early termination; use structured error handling to guarantee that temporary files are deleted even on failures.
  • Apply least-privilege principles to the web server and PHP interpreter so they cannot access or modify sensitive parts of the filesystem if compromised.

How teams detect issues like this

Detection approaches can combine code-level review with runtime monitoring:

  • Static analysis and code review:
  • Search for functions that download remote content (e.g., file_get_contents, cURL) followed by writes into paths under the web root.
  • Flag cases where filenames or extensions are derived directly from user input or remote URLs without normalization or restriction.
  • Identify directories configured as writable and simultaneously exposed as executable by the web server.
  • Review error-handling paths for die(), exit, or early returns that occur after files are written but before cleanup.
  • Configuration and policy checks:
  • Enforce policies that disallow executable interpreters (PHP, CGI, etc.) in cache or upload directories.
  • Use automated configuration scanners to verify that videos/cache/tmpFile/-like directories are non-executable or located outside the document root.
  • Runtime monitoring and logging:
  • Log creation of files in upload/cache directories and alert on unexpected executable extensions.
  • Monitor web server access logs for requests to cache or temporary directories, especially .php requests.
  • Integrate Web Application Firewalls (WAFs) to detect patterns indicative of file upload exploitation and web shell interaction.
  • Automated tooling:
  • Employ SAST tools configured with rules for CWE-434 to detect unsafe upload/download patterns.
  • Use DAST scanners that attempt to upload and access executable payloads in various endpoints to uncover misconfigurations.

Sources

SourceLink
github.comgithub.com/WWBN/AVideo/commit/6da79b43484099a0b660d1544a63c07b633ed3a2
github.comgithub.com/WWBN/AVideo/security/advisories/GHSA-8wf4-c4x3-h952

Frequently asked

questions

Yes. If the vulnerable endpoint is reachable over HTTP(S), an attacker can exploit it remotely by supplying a controlled downloadURL and malicious resolution parameter to cause a PHP file to be stored in a web-accessible location.

It depends on how the AVideo instance is configured. If the encoder endpoint is accessible to unauthenticated or low-privileged users, they may be able to exploit it without elevated privileges. The key requirement is the ability to send crafted requests to aVideoEncoder.json.php.

The most robust fix is to ensure that downloaded or uploaded files are never directly executable by the web server. This typically involves storing them outside the web root or in directories where script execution is disabled, using server-generated filenames with safe extensions, validating file types, and guaranteeing deletion of temporary files on all code paths.

Adopt a secure file handling strategy across the application: treat all user-supplied or remotely sourced files as untrusted, strictly separate storage from execution, implement centralized validation and sanitization routines, and establish coding guidelines that forbid writing attacker-controlled filenames or executable types under web-served directories. Incorporate automated security testing and code review checklists specifically targeting file upload and download logic.

Find out what's already
exploitable in your codebase.