CVE-2026-33035: Wwbn/avideo Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-wfq5-qgqp-hvhv
CWE-79
Published
Advisory Summary

CVE-2026-33035 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Wwbn/avideo libraries in the Packagist ecosystem. The issue involves unauthenticated reflected xss via innerhtml in avideo. Remediation is available in the latest vendor maintenance releases.

CVE-2026-33035 at a Glance

CVE Identifier CVE-2026-33035
GHSA Identifier GHSA-wfq5-qgqp-hvhv
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Wwbn/avideo
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-33035

To remediate this vulnerability, upgrade all affected Wwbn/avideo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

wwbn/avideo fixed: Latest secure release
Upgrade wwbn/avideo to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for wwbn/avideo

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-33035, inspect your project dependencies for Wwbn/avideo:

inspect dependencies for wwbn/avideo

Analyze the terminal output to locate any version of Wwbn/avideo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Wwbn/avideo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary AVideo contains a reflected XSS vulnerability that allows unauthenticated attackers to execute arbitrary JavaScript in a victim's browser. User input from a URL parameter flows through PHP's `json_encode()` into a JavaScript function that renders it via `innerHTML`, bypassing encoding and achieving full script execution. ## Root Cause The vulnerability is caused by two issues working together: ### 1. Source: Unescaped user input passed to JavaScript (videoNotFound.php) **File:** `view/videoNotFound.php` line 49 ```php if (!empty($_REQUEST['404ErrorMsg'])) { echo 'avideoAlertInfo(' . json_encode($_REQUEST['404ErrorMsg']) . ');'; } ``` PHP's `json_encode()` with default flags only escapes quotes (`"` → `\"`) and backslashes. It does **NOT** escape HTML special characters (`<`, `>`, `/`). The resulting string contains raw HTML tags that are passed directly to JavaScript. ### 2. Sink: innerHTML renders HTML tags as executable DOM (script.js) **File:** `view/js/script.js` ```javascript function avideoAlertInfo(msg) { // line ~1891 avideoAlert("", msg, 'info'); // calls ↓ } function avideoAlert(title, msg, type) { // line ~1270 avideoAlertHTMLText(title, msg, type); // calls ↓ } function avideoAlertHTMLText(title, msg, type) { // line ~1451 var span = document.createElement("span"); span.innerHTML = msg; // line 1464 — XSS SINK swal({ content: span }); } ``` `innerHTML` parses the string as HTML. Any `<img>`, `<svg>`, or other HTML tags with event handlers are instantiated as real DOM elements, triggering JavaScript execution. ### Data Flow ``` URL parameter (?404ErrorMsg=PAYLOAD) → $_REQUEST['404ErrorMsg'] → json_encode() ← does NOT escape < > / → avideoAlertInfo() → avideoAlert() → avideoAlertHTMLText() → span.innerHTML = msg ← renders HTML tags, executes JS ``` --- ## Proof of Concept ``` https://localhost/view/videoNotFound.php?404ErrorMsg=<img src=x onerror=alert(document.domain)> ``` <img width="1918" height="1035" alt="image" src="https://github.com/user-attachments/assets/20077ce2-5b49-4bd3-a7df-ab48be786cc1" /> The page renders: ```javascript avideoAlertInfo("<img src=x onerror=alert(document.domain)>"); ``` Which flows to `span.innerHTML = "<img src=x onerror=alert(document.domain)>"`. The browser creates an `<img>` element, `src=x` fails to load, `onerror` fires `alert(document.domain)`. ## Affected Code | File | Line | Issue | |------|------|-------| | `view/videoNotFound.php` | 49 | `json_encode()` does not escape `<` `>` for HTML context | | `view/js/script.js` | 1464 | `span.innerHTML = msg` renders user input as HTML | | `view/js/script.js` | 1282 | `span.innerHTML = msg` in `avideoAlertWithCookie()` | | `view/js/script.js` | 1335 | `span.innerHTML = __(msg,true)` in `avideoConfirm()` | | `view/js/script.js` | 1358 | `span.innerHTML = msg` in `avideoAlertOnceForceConfirm()` | The `innerHTML` sink exists in 4 functions. Any future code that passes user input to `avideoAlertInfo()`, `avideoAlertWarning()`, `avideoAlertDanger()`, or `avideoAlertSuccess()` will create additional XSS vectors. ## Remediation ### Fix 1: Escape HTML in PHP (source fix) ```php // view/videoNotFound.php line 49 // BEFORE (vulnerable): echo 'avideoAlertInfo(' . json_encode($_REQUEST['404ErrorMsg']) . ');'; // AFTER (fixed): echo 'avideoAlertInfo(' . json_encode($_REQUEST['404ErrorMsg'], JSON_HEX_TAG | JSON_HEX_AMP) . ');'; ``` `JSON_HEX_TAG` converts `<` → `\u003C` and `>` → `\u003E`, preventing HTML injection. ### Fix 2: Use textContent instead of innerHTML (sink fix, recommended) ```javascript // view/js/script.js - all alert functions // BEFORE (vulnerable): span.innerHTML = msg; // AFTER (fixed): span.textContent = msg; ``` `textContent` treats the string as plain text — HTML tags are displayed literally, never parsed or executed. ### Fix 3: Add Content-Security-Policy header (defense in depth) ``` Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' ``` ## Impact - **Session hijacking** — steal `PHPSESSID` cookie (not HttpOnly by default) - **Account takeover** — use stolen session to change password or email - **Phishing** — inject a realistic login form inside the SweetAlert modal - **Worm propagation** — inject self-spreading payloads via comments/messages - **Admin compromise** — send crafted link to admin, steal session, gain full control

CVE-2026-33035 Affected Wwbn/avideo Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
wwbn/avideo
Packagist
≤ 25.0

References

Frequently Asked Questions

What is CVE-2026-33035?
CVE-2026-33035 is a security vulnerability in Wwbn/avideo involving Unauthenticated Reflected XSS via innerHTML in AVideo under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Wwbn/avideo versions are affected?
Affected versions include releases prior to current release patches across affected packages: wwbn/avideo.
What version fixes CVE-2026-33035?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is wwbn/avideo affected?
Yes, wwbn/avideo is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2026-33035?
CVE-2026-33035 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2026-33035?
Run the dependency tree command: 'inspect dependencies for wwbn/avideo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wfq5-qgqp-hvhv",
  "modified" : "2026-03-20T21:22:24Z",
  "published" : "2026-03-17T20:05:23Z",
  "aliases" : [ "CVE-2026-33035" ],
  "summary" : "Unauthenticated Reflected XSS via innerHTML in AVideo",
  "details" : "## Summary\n\nAVideo contains a reflected XSS vulnerability that allows unauthenticated attackers to execute arbitrary JavaScript in a victim's browser. User input from a URL parameter flows through PHP's `json_encode()` into a JavaScript function that renders it via `innerHTML`, bypassing encoding and achieving full script execution.\n\n\n## Root Cause\nThe vulnerability is caused by two issues working together:\n\n### 1. Source: Unescaped user input passed to JavaScript (videoNotFound.php)\n\n**File:** `view/videoNotFound.php` line 49\n\n```php\nif (!empty($_REQUEST['404ErrorMsg'])) {\n    echo 'avideoAlertInfo(' . json_encode($_REQUEST['404ErrorMsg']) . ');';\n}\n```\n\nPHP's `json_encode()` with default flags only escapes quotes (`\"` → `\\\"`) and backslashes. It does **NOT** escape HTML special characters (`<`, `>`, `/`). The resulting string contains raw HTML tags that are passed directly to JavaScript.\n\n### 2. Sink: innerHTML renders HTML tags as executable DOM (script.js)\n\n**File:** `view/js/script.js`\n\n```javascript\nfunction avideoAlertInfo(msg) {            // line ~1891\n    avideoAlert(\"\", msg, 'info');           // calls ↓\n}\n\nfunction avideoAlert(title, msg, type) {   // line ~1270\n    avideoAlertHTMLText(title, msg, type);  // calls ↓\n}\n\nfunction avideoAlertHTMLText(title, msg, type) {  // line ~1451\n    var span = document.createElement(\"span\");\n    span.innerHTML = msg;                  // line 1464 — XSS SINK\n    swal({ content: span });\n}\n```\n\n`innerHTML` parses the string as HTML. Any `<img>`, `<svg>`, or other HTML tags with event handlers are instantiated as real DOM elements, triggering JavaScript execution.\n\n### Data Flow\n\n```\nURL parameter (?404ErrorMsg=PAYLOAD)\n    → $_REQUEST['404ErrorMsg']\n    → json_encode()          ← does NOT escape < > /\n    → avideoAlertInfo()\n    → avideoAlert()\n    → avideoAlertHTMLText()\n    → span.innerHTML = msg   ← renders HTML tags, executes JS\n```\n\n---\n\n## Proof of Concept\n```\nhttps://localhost/view/videoNotFound.php?404ErrorMsg=<img src=x onerror=alert(document.domain)>\n```\n<img width=\"1918\" height=\"1035\" alt=\"image\" src=\"https://github.com/user-attachments/assets/20077ce2-5b49-4bd3-a7df-ab48be786cc1\" />\n\nThe page renders:\n```javascript\navideoAlertInfo(\"<img src=x onerror=alert(document.domain)>\");\n```\n\nWhich flows to `span.innerHTML = \"<img src=x onerror=alert(document.domain)>\"`. The browser creates an `<img>` element, `src=x` fails to load, `onerror` fires `alert(document.domain)`.\n\n## Affected Code\n\n| File | Line | Issue |\n|------|------|-------|\n| `view/videoNotFound.php` | 49 | `json_encode()` does not escape `<` `>` for HTML context |\n| `view/js/script.js` | 1464 | `span.innerHTML = msg` renders user input as HTML |\n| `view/js/script.js` | 1282 | `span.innerHTML = msg` in `avideoAlertWithCookie()` |\n| `view/js/script.js` | 1335 | `span.innerHTML = __(msg,true)` in `avideoConfirm()` |\n| `view/js/script.js` | 1358 | `span.innerHTML = msg` in `avideoAlertOnceForceConfirm()` |\n\nThe `innerHTML` sink exists in 4 functions. Any future code that passes user input to `avideoAlertInfo()`, `avideoAlertWarning()`, `avideoAlertDanger()`, or `avideoAlertSuccess()` will create additional XSS vectors.\n\n\n## Remediation\n\n### Fix 1: Escape HTML in PHP (source fix)\n\n```php\n// view/videoNotFound.php line 49\n// BEFORE (vulnerable):\necho 'avideoAlertInfo(' . json_encode($_REQUEST['404ErrorMsg']) . ');';\n\n// AFTER (fixed):\necho 'avideoAlertInfo(' . json_encode($_REQUEST['404ErrorMsg'], JSON_HEX_TAG | JSON_HEX_AMP) . ');';\n```\n\n`JSON_HEX_TAG` converts `<` → `\\u003C` and `>` → `\\u003E`, preventing HTML injection.\n\n### Fix 2: Use textContent instead of innerHTML (sink fix, recommended)\n\n```javascript\n// view/js/script.js - all alert functions\n// BEFORE (vulnerable):\nspan.innerHTML = msg;\n\n// AFTER (fixed):\nspan.textContent = msg;\n```\n\n`textContent` treats the string as plain text — HTML tags are displayed literally, never parsed or executed.\n\n### Fix 3: Add Content-Security-Policy header (defense in depth)\n\n```\nContent-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'\n```\n\n## Impact\n\n- **Session hijacking** — steal `PHPSESSID` cookie (not HttpOnly by default)\n- **Account takeover** — use stolen session to change password or email\n- **Phishing** — inject a realistic login form inside the SweetAlert modal\n- **Worm propagation** — inject self-spreading payloads via comments/messages\n- **Admin compromise** — send crafted link to admin, steal session, gain full control",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "wwbn/avideo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "25.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/WWBN/AVideo/security/advisories/GHSA-wfq5-qgqp-hvhv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33035"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/WWBN/AVideo/commit/cca6196f4072cb9acc39b1030fb8fb1702b4f69b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/WWBN/AVideo"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-17T20:05:23Z",
    "nvd_published_at" : "2026-03-20T05:16:16Z"
  }
}