/

CVE-2026-40926

Severity:

HIGH RISK

(7.1)

CSRF in WWBN AVideo Admin JSON Endpoints

CVE-2026-40926

Analyzed

Vulnerability type

Category:

Cross-Site Request Forgery (CSRF)

CWE:

CWE-352

Impact:

Unauthorized State-Changing Actions via Admin Session

Severity:

HIGH RISK

(7.1)

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

Several admin-only JSON endpoints in WWBN AVideo omit CSRF validation, allowing state-changing database operations to be triggered solely based on the victim's existing session.

If an attacker can lure a logged-in administrator to a malicious page, they can silently create, modify, or delete categories and trigger plugin update scripts in the admin's context.

Affected context

This vulnerability affects WWBN AVideo deployments where administrators are logged into the web interface and their browser retains an active session.

The issue occurs in specific admin-only JSON endpoints:

  • objects/categoryAddNew.json.php
  • objects/categoryDelete.json.php
  • objects/pluginRunUpdateScript.json.php

These endpoints perform privileged, state-changing operations without enforcing CSRF protection, even though neighboring endpoints in the same directory do require CSRF tokens.

Exploit preconditions

  • Attack surface: Browser-based HTTP requests to affected JSON endpoints on an AVideo instance.
  • Required access:
  • The victim must be an authenticated administrator with a valid session.
  • The attacker needs only the ability to get that admin to load or interact with attacker-controlled content (e.g., a web page, HTML email, or injected ad).
  • Trigger point:
  • A crafted cross-origin request (e.g., form POST, XHR/fetch with relaxed CORS, image tags for GET endpoints) sent from the attacker's page while the admin is logged in.
  • Why exploitation is possible:
  • The endpoints rely solely on role checks (Category::canCreateCategory(), User::isAdmin()) and do not call isGlobalTokenValid() or forbidIfIsUntrustedRequest().
  • Browsers automatically attach session cookies to cross-site requests, so the application treats attacker-initiated requests as if the admin sent them.

Why this happens

The core issue is incomplete CSRF protection on privileged endpoints.

While AVideo has mechanisms such as isGlobalTokenValid() and forbidIfIsUntrustedRequest() to validate request authenticity, these specific admin JSON handlers omit those checks and trust any request that carries a valid admin session cookie.

This maps directly to CWE-352: Cross-Site Request Forgery (CSRF), where an application performs sensitive, state-changing operations based solely on ambient authentication state without verifying that the user intentionally initiated the action.

The inconsistency with neighboring endpoints that do enforce CSRF tokens indicates an implementation oversight rather than a deliberate design.

Potential impact

  • An attacker can create new categories under the administrator's account.
  • Existing categories can be deleted, potentially disrupting content organization and access workflows.
  • Category data can be altered, leading to misclassification or hiding of content.
  • Any installed plugin's updateScript() method can be executed, which may:
  • Change plugin configuration or schema.
  • Trigger data migrations or maintenance tasks unexpectedly.
  • Amplify impact if update scripts have side effects or elevated capabilities.
  • Administrative audit trails may misleadingly attribute changes to the victim admin user.
  • Chained with other weaknesses in plugins or update scripts, the issue could contribute to broader system compromise.

General mitigation guidance

Effective mitigation centers on enforcing strong CSRF defenses consistently across all privileged endpoints and reducing reliance on ambient trust from sessions:

  • Require a validated anti-CSRF token (synchronizer token pattern or equivalent) for all state-changing admin actions, including JSON and AJAX endpoints.
  • Centralize CSRF enforcement in shared middleware or base controllers so that new endpoints inherit protection by default.
  • Treat browser-initiated JSON endpoints as sensitive APIs and require both authentication and an explicit trust signal (token, same-site checks, or double-submit cookie).
  • Use secure-by-default cookie attributes (e.g., SameSite=Lax or Strict where usable) to limit cross-site requests from carrying session cookies.
  • Favor idempotent, read-only methods (GET) for retrieval and restrict state changes to POST/PUT/DELETE with CSRF validation.
  • Apply least privilege in plugin and update-script design so that any single action has bounded impact if misused.

How teams detect issues like this

Identifying similar issues typically involves a combination of code analysis and behavioral testing:

  • Static analysis and code review:
  • Search for state-changing endpoints (e.g., database writes, category modifications, plugin updates) that do not call CSRF validation helpers like isGlobalTokenValid() or forbidIfIsUntrustedRequest().
  • Review admin-only JSON and AJAX handlers to ensure they enforce both authentication and CSRF protections.
  • Use static analysis rules or custom linters to flag controllers or scripts under objects/*.json.php that lack CSRF checks.
  • Dynamic and functional testing:
  • Perform CSRF test cases using crafted HTML forms or JavaScript on a separate origin to see which admin actions can be triggered without a token.
  • Integrate security testing into CI pipelines to automatically probe critical admin endpoints for CSRF.
  • Policy and configuration checks:
  • Enforce project-level guidelines requiring CSRF enforcement on all non-idempotent endpoints.
  • Use automated review tools that validate adherence to secure coding patterns for authentication and request validation.

Sources

SourceLink
github.comgithub.com/WWBN/AVideo/commit/ee5615153c40628ab3ec6fe04962d1f92e67d3e2
github.comgithub.com/WWBN/AVideo/security/advisories/GHSA-ffw8-fwxp-h64w

Frequently asked

questions

Yes. An attacker can exploit this remotely by getting an authenticated admin to visit a malicious site.

The attack works through the victim's browser, which sends authenticated requests to the AVideo instance.

The attacker does not need direct access to AVideo.

They only need the ability to get an administrator with an active session to load attacker-controlled content that issues the crafted requests.

The most robust fix is to require CSRF validation for all state-changing admin endpoints.

That typically means centralizing CSRF token checks in shared middleware, ensuring JSON/AJAX handlers call the same protection functions, and verifying both authentication and a valid anti-CSRF token before performing database updates or plugin actions.

Prevention relies on making CSRF protection a default behavior:

  • Implement CSRF enforcement at the framework or base-controller level so developers must explicitly opt out (and justify) rather than opt in.
  • Maintain checklists or security guidelines for new endpoints, ensuring any action that changes state validates an anti-CSRF token.
  • Use automated tools and code review patterns that flag new or modified privileged endpoints lacking standardized CSRF checks.
Find out what's already
exploitable in your codebase.