/

CVE-2026-33479

Severity:

HIGH RISK

(8.8)

Code Injection in WWBN AVideo Gallery Plugin saveSort

CVE-2026-33479

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution via CSRF

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

The WWBN AVideo Gallery plugin up to version 26.0 uses unsanitized $_REQUEST['sections'] data directly in PHP's eval() function within the saveSort.json.php endpoint.

Because the endpoint is protected only by an admin session and lacks CSRF validation, attackers can abuse cross-site request forgery to execute arbitrary PHP code when an authenticated admin visits a malicious page.

Affected context

This vulnerability occurs in WWBN AVideo installations using the Gallery plugin up to and including version 26.0.

The affected endpoint is saveSort.json.php, which is intended to process sort ordering data for gallery sections and is gated behind User::isAdmin() checks.

The issue manifests when the application:

  • Accepts section data from $_REQUEST['sections'] on the admin side,
  • Uses eval() to process that data without sanitization or validation,
  • And relies on a session cookie explicitly configured with SameSite=None while not enforcing CSRF tokens for this endpoint.

Exploit preconditions

  • Attack surface: HTTP POST/GET requests to the saveSort.json.php endpoint of the Gallery plugin.
  • Required access: The victim must be an authenticated admin in the same browser session; the attacker can be unauthenticated.
  • Trigger point: An admin user visiting or interacting with an attacker-controlled webpage (or embedded content) that silently issues crafted requests to saveSort.json.php.
  • Why exploitation is possible:
  • The endpoint accepts request data from $_REQUEST['sections'] and passes it directly into PHP's eval(), enabling execution of attacker-controlled PHP code.
  • The only logical gate is User::isAdmin(), which is satisfied automatically when the victim admin is logged in.
  • No CSRF tokens or origin checks are enforced, and the SameSite=None cookie configuration allows cross-site requests to carry the admin's session cookie.

Why this happens

The core flaw is the use of dynamic code evaluation (eval()) on untrusted input derived from the $_REQUEST['sections'] array. This maps directly to CWE-94: Improper Control of Generation of Code ('Code Injection').

Rather than treating incoming data as simple values (e.g., IDs or sort positions), the implementation treats that data as executable PHP code and evaluates it at runtime.

In combination with missing CSRF protections and permissive session cookie settings, this design allows attackers to inject and run arbitrary code through cross-site requests, even though the endpoint is intended to be restricted to administrators.

Potential impact

  • Remote execution of arbitrary PHP code in the web server context.
  • Full compromise of the AVideo instance, including modification or deletion of video content and configuration.
  • Theft or manipulation of user data stored by the platform.
  • Installation of web shells or backdoors for persistent access.
  • Use of the compromised server to pivot into internal networks or stage further attacks.

General mitigation guidance

Effective mitigation centers on eliminating dynamic code evaluation and tightening cross-site protections:

  • Replace eval() with explicit, data-driven logic that operates on validated values (e.g., numeric IDs, whitelisted field names) instead of interpreted PHP code.
  • Treat all request parameters, including those on admin endpoints, as untrusted; apply strict validation, encoding, and whitelisting for expected formats.
  • Enforce robust CSRF defenses on all state-changing endpoints, such as synchronizer tokens or double-submit cookies, and validate them server-side.
  • Avoid designs that depend on executing code constructed from user-controlled or semi-trusted configuration data; prefer declarative data structures.
  • Apply least-privilege principles to the application runtime so that, if code execution occurs, underlying system impact is reduced.
  • Review session and cookie policies (including SameSite) to support CSRF defenses rather than weaken them.

How teams detect issues like this

Detection can focus on both code patterns and runtime behavior:

  • Static analysis and code scanning:
  • Flag uses of eval(), create_function(), assert() with string arguments, or other dynamic code execution primitives, especially when arguments are derived from $_GET, $_POST, $_REQUEST, or other external sources.
  • Identify admin endpoints or JSON handlers that process arrays or complex data structures and confirm they do not translate directly into code.
  • Enforce policy checks that require CSRF protection on all state-changing routes and fail builds when unsafe use of eval() is detected.
  • Manual code review:
  • Inspect admin-only scripts (e.g., saveSort.json.php) for assumptions about trustworthiness of request data.
  • Verify that cookie configuration, CSRF validation, and origin/referrer checks are consistent with security expectations.
  • Runtime and log-based monitoring:
  • Monitor for anomalous requests to saveSort.json.php with unexpected payloads or from untrusted origins.
  • Use application-level logging to detect unusual execution flows or errors originating from dynamically evaluated code.
  • Automated code review tools can be configured with custom rules to highlight any use of dynamic evaluation functions and missing CSRF protections on sensitive endpoints.

Sources

SourceLink
github.comgithub.com/WWBN/AVideo/commit/087dab8841f8bdb54be184105ef19b47c5698fcb
github.comgithub.com/WWBN/AVideo/security/advisories/GHSA-xggw-g9pm-9qhh

Frequently asked

questions

The vulnerability can be exploited by any attacker who can induce an authenticated admin to load an attacker-controlled webpage while logged in. The attacker does not need direct access to the AVideo admin interface; the weakness is reachable via cross-site requests that leverage the admin's existing session.

The attacker does not need their own account. However, exploitation depends on a logged-in admin's session because the saveSort.json.php endpoint checks User::isAdmin(). The attacker's page simply triggers requests that reuse the admin's authenticated session and bypass the admin's awareness.

The most robust fix is to remove or strictly limit dynamic code evaluation: avoid eval() entirely and rewrite the logic to operate only on validated, typed input (such as numeric IDs and sort orders). At the same time, enforce CSRF protection on all state-changing endpoints and ensure session and cookie policies align with these protections.

Avoid designs that transform user-supplied data into executable code and enforce a blanket rule against eval() and equivalent constructs in production code. Combine this with a secure-by-default framework for CSRF protection, regular secure code reviews focusing on admin and JSON endpoints, and automated static analysis rules that flag dynamic code evaluation and missing CSRF checks.

Find out what's already
exploitable in your codebase.