{"id":"GHSA-fj74-qxj7-r3vc","summary":"AVideo has SQL Injection via Partial Prepared Statement — videos_id Concatenated Directly into Query","details":"### Summary\n\nIn `objects/like.php`, the `getLike()` method constructs a SQL query using a prepared statement placeholder (`?`) for `users_id` but directly concatenates `$this-\u003evideos_id` into the query string without parameterization. An attacker who can control the `videos_id` value (via a crafted request) can inject arbitrary SQL, bypassing the partial prepared-statement protection.\n\n### Details\n\n**File:** `objects/like.php`\n\n**Vulnerable code:**\n```php\n$sql = \"SELECT * FROM likes WHERE users_id = ? AND videos_id = \".$this-\u003evideos_id.\" LIMIT 1;\";\n$res = sqlDAL::readSql($sql, \"i\", [$this-\u003eusers_id]);\n```\n\nThe query mixes a parameterized placeholder for `users_id` with raw string concatenation for `videos_id`. The `$this-\u003evideos_id` value originates from user-supplied request input (typically a POST/GET parameter identifying the video being liked/disliked) and is not cast to integer or validated before being embedded in the SQL string.\n\nAll other queries in the same file correctly use `?` placeholders for both columns:\n```php\n// Correct pattern used elsewhere:\n$sql = \"SELECT count(*) as total FROM likes WHERE videos_id = ? AND like = 1\";\n```\n\nThe inconsistency means any attacker who can submit a like/dislike action with a crafted `videos_id` can inject SQL. Since like/dislike actions are typically available to any authenticated user, the attack surface is broad.\n\n### PoC\n\nAn attacker sends a like request with an injected `videos_id`:\n```\nPOST /objects/likeAjax.json.php\nvideos_id=1 UNION SELECT user,password,3,4,5,6,7,8 FROM users-- -\n```\n\nThis causes the backend to execute:\n```sql\nSELECT * FROM likes WHERE users_id = 1 AND videos_id = 1 UNION SELECT user,password,3,4,5,6,7,8 FROM users-- - LIMIT 1;\n```\n\nResult: full database read — user credentials, emails, private content, and any other data accessible to the MySQL user.\n\n### Impact\n\n- **Severity:** High\n- **Authentication required:** Yes (must be logged in to like a video), but all registered users qualify\n- **Impact:** Full database read via UNION-based injection; potential for data modification or deletion depending on DB user privileges\n- **Fix:** Replace the concatenation with a second `?` placeholder and pass `$this-\u003evideos_id` as a bound integer parameter","aliases":["CVE-2026-33767"],"modified":"2026-03-27T21:51:13.745542Z","published":"2026-03-26T18:12:33Z","database_specific":{"cwe_ids":["CWE-89"],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-03-26T18:12:33Z","nvd_published_at":"2026-03-27T17:16:29Z"},"references":[{"type":"WEB","url":"https://github.com/WWBN/AVideo/security/advisories/GHSA-fj74-qxj7-r3vc"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33767"},{"type":"WEB","url":"https://github.com/WWBN/AVideo/commit/0215d3c4f1ee748b8880254967b51784b8ac4080"},{"type":"PACKAGE","url":"https://github.com/WWBN/AVideo"}],"affected":[{"package":{"name":"wwbn/avideo","ecosystem":"Packagist","purl":"pkg:composer/wwbn/avideo"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.0"}]}],"versions":["10.4","10.8","11","11.1","11.1.1","11.5","11.6","12.4","14.3","14.3.1","14.4","18.0","21.0","22.0","24.0","25.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-fj74-qxj7-r3vc/GHSA-fj74-qxj7-r3vc.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"}]}