GHSA-8p2x-5cpm-qrqw
AVideo vulnerable to IP Address Spoofing via Untrusted HTTP Headers in getRealIpAddr()
Details
## Summary
The `getRealIpAddr()` function in `objects/functions.php` trusts user-controlled HTTP headers to determine the client's IP address. An attacker can spoof their IP address by sending forged headers, bypassing any IP-based access controls or audit logging.
## Vulnerable Code
File: `objects/functions.php` ```php $headers = [ 'HTTP_X_REAL_IP', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR' ];
foreach ($headers as $header) { if (!empty($_SERVER[$header])) { $ips = explode(',', $_SERVER[$header]); foreach ($ips as $ipCandidate) { $ipCandidate = trim($ipCandidate); if (filter_var($ipCandidate, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { return $ipCandidate; } } } } ```
## Attack Scenario
1. Attacker sends request with forged header: ``` X-Client-IP: 127.0.0.1 ``` or ``` X-Real-IP: 192.168.1.1 ```
2. `getRealIpAddr()` returns the forged IP 3. Any IP-based rate limiting, access control, or audit log that relies on this function is bypassed
## Proof of Concept ```bash curl -H "X-Client-IP: 127.0.0.1" \ https://target.com/any_endpoint.php ```
The server now believes the request came from localhost.
## Impact - Bypass IP-based rate limiting - Bypass IP-based access controls - Forge audit log entries - Potential privilege escalation if localhost is trusted
Are you affected?
Enter the version of the package you're using.
Affected packages
0No fixed version published yet for wwbn/avideo (composer). Pin to a known-safe version or switch to an alternative.
References
Check it before you install it
One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.
curl -s https://vdb.ai.kr/v1/ai/check-packages \
-H 'Content-Type: application/json' \
-d '{"packages":["pkg:composer/wwbn/avideo"]}'