Skip to content

Commit de02b02

Browse files
1 parent a525951 commit de02b02

2 files changed

Lines changed: 122 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-f359-r3pv-2phf",
4+
"modified": "2026-03-26T18:10:48Z",
5+
"published": "2026-03-26T18:10:48Z",
6+
"aliases": [
7+
"CVE-2026-33766"
8+
],
9+
"summary": "AVideo has SSRF Protection Bypass via HTTP Redirect in Image Download Endpoints",
10+
"details": "## Summary\n\n`isSSRFSafeURL()` validates URLs against private/reserved IP ranges before fetching, but `url_get_contents()` follows HTTP redirects without re-validating the redirect target. An attacker can bypass SSRF protection by redirecting from a public URL to an internal target.\n\n## Root Cause\n\n**Check-time:** `isSSRFSafeURL()` at `objects/functions.php:4066` resolves the hostname and validates the IP.\n\n**Use-time:** `url_get_contents()` at `objects/functions.php:1990` calls `file_get_contents()` with PHP's default `follow_location=1` — redirects are followed without re-validation. The wget fallback at line 2047 also follows redirects by default.\n\n**Affected endpoint:** `objects/aVideoEncoderReceiveImage.json.php` at lines 67-68, 107-108, 135-136, 160-161:\n```php\nif (isValidURL($_REQUEST['downloadURL_image']) && isSSRFSafeURL($_REQUEST['downloadURL_image'])) {\n $content = url_get_contents($_REQUEST['downloadURL_image']);\n```\n\n## Proof of Concept\n\n1. Attacker sets up `https://attacker.com/redir` to respond with `302 Location: http://169.254.169.254/latest/meta-data/`\n2. Authenticated user (with upload+edit permissions) triggers image download:\n```\nGET /objects/aVideoEncoderReceiveImage.json.php?downloadURL_image=https://attacker.com/redir&...\n```\n3. `isSSRFSafeURL()` resolves `attacker.com` → public IP → passes validation\n4. `url_get_contents()` follows 302 redirect to `169.254.169.254` → SSRF\n\n## Impact\n\n- Cloud metadata access (AWS IMDSv1, GCP, Azure)\n- Internal network service access\n- Bypasses the existing SSRF protection that was added to prevent exactly this class of attack\n\n## Note\n\nThe curl path in `url_get_contents()` does NOT set `CURLOPT_FOLLOWLOCATION` so it is not affected. Only the `file_get_contents` and `wget` fallback paths are vulnerable.\n\n## Suggested Fix\n\nSet `follow_location` to `0` in the stream context and handle redirects manually with re-validation, or add `isSSRFSafeURL()` check inside `url_get_contents()` after resolving the final URL.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V4",
14+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Packagist",
21+
"name": "wwbn/avideo"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"last_affected": "14.3"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/WWBN/AVideo/security/advisories/GHSA-f359-r3pv-2phf"
42+
},
43+
{
44+
"type": "WEB",
45+
"url": "https://github.com/WWBN/AVideo/commit/8b7e9dad359d5fac69e0cbbb370250e0b284bc12"
46+
},
47+
{
48+
"type": "PACKAGE",
49+
"url": "https://github.com/WWBN/AVideo"
50+
}
51+
],
52+
"database_specific": {
53+
"cwe_ids": [
54+
"CWE-918"
55+
],
56+
"severity": "MODERATE",
57+
"github_reviewed": true,
58+
"github_reviewed_at": "2026-03-26T18:10:48Z",
59+
"nvd_published_at": null
60+
}
61+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-fj74-qxj7-r3vc",
4+
"modified": "2026-03-26T18:12:33Z",
5+
"published": "2026-03-26T18:12:33Z",
6+
"aliases": [
7+
"CVE-2026-33767"
8+
],
9+
"summary": "AVideo has SQL Injection via Partial Prepared Statement — videos_id Concatenated Directly into Query",
10+
"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->videos_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->videos_id.\" LIMIT 1;\";\n$res = sqlDAL::readSql($sql, \"i\", [$this->users_id]);\n```\n\nThe query mixes a parameterized placeholder for `users_id` with raw string concatenation for `videos_id`. The `$this->videos_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->videos_id` as a bound integer parameter",
11+
"severity": [
12+
{
13+
"type": "CVSS_V4",
14+
"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"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Packagist",
21+
"name": "wwbn/avideo"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "26.0"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/WWBN/AVideo/security/advisories/GHSA-fj74-qxj7-r3vc"
42+
},
43+
{
44+
"type": "WEB",
45+
"url": "https://github.com/WWBN/AVideo/commit/0215d3c4f1ee748b8880254967b51784b8ac4080"
46+
},
47+
{
48+
"type": "PACKAGE",
49+
"url": "https://github.com/WWBN/AVideo"
50+
}
51+
],
52+
"database_specific": {
53+
"cwe_ids": [
54+
"CWE-89"
55+
],
56+
"severity": "HIGH",
57+
"github_reviewed": true,
58+
"github_reviewed_at": "2026-03-26T18:12:33Z",
59+
"nvd_published_at": null
60+
}
61+
}

0 commit comments

Comments
 (0)