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.phpobjects/categoryDelete.json.phpobjects/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 callisGlobalTokenValid()orforbidIfIsUntrustedRequest(). - 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=LaxorStrictwhere 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()orforbidIfIsUntrustedRequest(). - 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.phpthat 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.

